# NOT RUN {
m <- lvm(Y~X1+X2)
set.seed(10)
d <- lava::sim(m, 2e1)
## Gold standard
summary(lm(Y~X1+X2, d))$coef
## gls models
library(nlme)
e.gls <- gls(Y~X1+X2, data = d, method = "ML")
summary(e.gls)$tTable
sCorrect(e.gls, cluster = 1:NROW(d)) <- FALSE ## no small sample correction
summary2(e.gls)$tTable
sCorrect(e.gls, cluster = 1:NROW(d)) <- TRUE ## small sample correction
summary2(e.gls)$tTable
## lvm models
e.lvm <- estimate(m, data = d)
summary(e.lvm)$coef
sCorrect(e.lvm) <- FALSE ## no small sample correction
summary2(e.lvm)$coef
sCorrect(e.lvm) <- TRUE ## small sample correction
summary2(e.lvm)$coef
# }
Run the code above in your browser using DataLab