deff_calc {pollster} | R 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)
[Package pollster version 0.1.6 Index]