reliability: Calculate reliability coefficients for random effects

View source: R/reliability.R

reliabilityR Documentation

Calculate reliability coefficients for random effects

Description

This function computes reliability coefficients for random effects according to Raudenbush and Bryk (2002) and Snijders and Bosker (2012). The reliability coefficient is equal to the proportion of between group variance to total variance: \frac{\tau^2}{\tau^2 + {\frac{\sigma^2}{n_j}}}. The empirical Bayes estimator for the random effect is a weighted combination of the cluster mean and grand mean with the weight given by the reliability of the random effect. We refer to this as a reliability because in classical test theory the ratio of the true score variance, \tau^2, relative to the observed score variance of the sample mean is a reliability. A reliability close to 1 puts more weight on the cluster mean while a reliability close to 0 put more weight on the grand mean.

Usage

reliability(model)

Arguments

model

A model produced using the lme4::lmer() or lme4::glmer() functions. This is an object of class merMod and subclass lmerMod or glmerMod.

Value

A list with reliability estimates for each random effect

References

\insertRef

snijders2012mlmhelpr

\insertRef

raudenbush2002mlmhelpr

Examples


# lmer model
fit <- lme4::lmer(mathach ~ 1 + ses + catholic + (1 + ses|id),
data=hsb, REML=TRUE)

reliability(fit)



lrocconi/mlmhelpr documentation built on Dec. 9, 2024, 10:58 p.m.