if (FALSE) {
# simple example of a model using builtin data
# demonstrates use
test <- mplusObject(
TITLE = "test the MplusAutomation Package;",
MODEL = "
mpg ON wt hp;
wt WITH hp;",
OUTPUT = "STANDARDIZED; CINTERVAL;",
usevariables = c("mpg", "wt", "hp"),
rdata = mtcars)
res <- mplusModeler(test, "mtcars.dat", modelout = "model1.inp", run = 1L)
# example of the confint method on an mplus.model object
# note that res$results holds the results of readModels()
confint(res$results)
confint(res$results, type = "std")
confint(res$results, type = "stdy")
confint(res$results, type = "stdyx", level = .99)
# there is also a method for mplusObject class
confint(res)
screenreg(res, cis = TRUE, single.row = TRUE)
# remove files
unlink("mtcars.dat")
unlink("model1.inp")
unlink("model1.out")
unlink("Mplus Run Models.log")
}
Run the code above in your browser using DataLab