# NOT RUN {
data(HolzingerSwineford)
semmodel<-'
L1 =~ V1 + V2 + V3
L2 =~ V4 + V5 + V6
L3 =~ V7 + V8
L4 =~ V9 + V10 + V11
'
# If raw data are available;
test <- eqMI.main(model = semmodel, data = HolzingerSwineford,
group = "school", meanstructure = TRUE,
output = 'both', quiet = FALSE,
equivalence.test = TRUE, adjRMSEA = TRUE,
projection = TRUE, bootstrap = FALSE)
# when only sample statistics are available;
# sample.cov need to be provided for tests of covariance structure;
# sample.mean need to be provided for tests of mean structure;
school1 <- subset(HolzingerSwineford, school==1)[,-12]
school2 <- subset(HolzingerSwineford, school==2)[,-12]
test <- eqMI.main(model = semmodel,
sample.nobs = c(nrow(school1), nrow(school2)),
sample.cov = list(cov(school1), cov(school2)),
sample.mean = list(colMeans(school1), colMeans(school2)),
meanstructure = TRUE, output = 'both', quiet = FALSE,
equivalence.test = TRUE, adjRMSEA = TRUE,
projection = TRUE, bootstrap = FALSE)
# }
Run the code above in your browser using DataLab