sjstats (version 0.17.9)

se_ybar: Standard error of sample mean for mixed models

Description

Compute the standard error for the sample mean for mixed models, regarding the extent to which clustering affects the standard errors. May be used as part of the multilevel power calculation for cluster sampling (see Gelman and Hill 2007, 447ff).

Usage

se_ybar(fit)

Arguments

fit

Fitted mixed effects model (merMod-class).

Value

The standard error of the sample mean of fit.

References

Gelman A, Hill J. 2007. Data analysis using regression and multilevel/hierarchical models. Cambridge, New York: Cambridge University Press

Examples

Run this code
# NOT RUN {
if (require("lme4")) {
  fit <- lmer(Reaction ~ 1 + (1 | Subject), sleepstudy)
  se_ybar(fit)
}
# }

Run the code above in your browser using DataCamp Workspace