View source: R/diary_functions.R
deffs | R Documentation |
deffs
computes the design effects for multilevel numeric data. 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.
deffs(data, vrb.nm, grp.nm, how = "lme", REML = FALSE)
data |
data.frame of data. |
vrb.nm |
character vector of colnames from |
grp.nm |
character vector of length 1 of a colname from |
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". |
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).
double vector providing the design effects with names =
vrb.nm
.
Huang, F. L. (2018). Multilevel modeling myths School Psychology Quarterly, 33(3), 492-499.
iccs_11
deff
iccs_11(data = airquality, vrb.nm = c("Ozone","Solar.R"), grp.nm = "Month")
lengths_by(data = airquality, vrb.nm = c("Ozone","Solar.R"), grp.nm = "Month", na.rm = TRUE)
deffs(data = airquality, vrb.nm = c("Ozone","Solar.R"), grp.nm = "Month")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.