deff {quest} | R Documentation |
Design Effect from Multilevel Numeric Vector
Description
deff
computes the design effect for a multilevel numeric vector.
Design effects summarize how much larger sampling variances (i.e., squared
standard errors) are due to the multilevel structure of the data. By taking
the square root, the value summarizes how much larger standard errors are due
to the multilevel structure of the data.
Usage
deff(x, grp, how = "lme", REML = TRUE)
Arguments
x |
numeric vector. |
grp |
atomic vector the same length as |
how |
character vector of length 1 specifying how the ICC(1,1) should be
calculated. There are four options: 1) "lme" uses a linear mixed effects
model with the function |
REML |
logical vector of length 1 specifying whether restricted maximum likelihood estimation (TRUE) should be used rather than traditional maximum likelihood estimation (FALSE). Only used for linear mixed effects models if how = "lme" or how = "lmer". |
Details
Design effects are a function of both the intraclass correlation (ICC) and the average group size. Design effects can be large due to large ICCs and small group sizes or small ICCs and large group sizes. For example, with an ICC = .01 and average group size of 100, the design effect would be 2.0, whose square root is 1.41. For more information, see myths 1 and 2 in Huang (2018).
Value
double vector of lenght 1 providing the design effect.
References
Huang, F. L. (2018). Multilevel modeling myths School Psychology Quarterly, 33(3), 492-499.
See Also
Examples
icc_11(x = airquality$"Ozone", grp = airquality$"Month")
length_by(x = airquality$"Ozone", grp = airquality$"Month", na.rm = TRUE)
deff(x = airquality$"Ozone", grp = airquality$"Month")
sqrt(deff(x = airquality$"Ozone", grp = airquality$"Month")) # how much SE inflated