deff_calc: Calculate the design effect of a sample

View source: R/DesignEffectAndMOE.R

deff_calcR Documentation

Calculate the design effect of a sample

Description

deff_calc returns a single number

Usage

deff_calc(w)

Arguments

w

a vector of weights

Details

This function returns the design effect of a given sample using the formula length(w)*sum(w^2)/(sum(w)^2). It is designed for use in the moe family of functions. If any weights are equal to 0, they are removed prior to calculation.

Value

A number

Examples

deff_calc(illinois$weight)


jdjohn215/pollster documentation built on May 19, 2023, 4:34 p.m.