# Linear mixed model with heteroscedastic residuals
mod <- galamm(
formula = y ~ x + (1 | id),
weights = ~ (1 | item),
data = hsced
)
# Extract information on variance and covariance
VarCorr(mod)
# Convert to data frame
# (this invokes lme4's function as.data.frame.VarCorr.merMod)
as.data.frame(VarCorr(mod))
Run the code above in your browser using DataLab