fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy, REML=TRUE)
class(fm1)
set.seed(123)
sleepstudy2 <- sleepstudy[sample(nrow(sleepstudy), size=120), ]
fm2 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy2, REML=TRUE)
## Here the adjusted and unadjusted covariance matrices are identical,
## but that is not generally the case:
v1 <- vcov(fm1)
v1a <- vcovAdj(fm1, details=0)
v1a / v1
v2 <- vcov(fm2)
v2a <- vcovAdj(fm2, details=0)
v2a / v2
# For comparison, an alternative estimate of the
# variance-covariance matrix is based on parametric bootstrap (and
# this is easily parallelized):
Run the code above in your browser using DataLab