# NOT RUN {
## Example using the built in iris dataset
s <- SEMSummary(~ Sepal.Length + Sepal.Width + Petal.Length, data = iris)
s # show output ... not very nice
## Prettier output from SEMSummary
APAStyler(s)
#### Subset the dataset and use the . expansion ####
## summary for all variables in mtcars data set
## with 11 variables, this could be a pain to write out
SEMSummary(~ ., data = mtcars)
## . expansion is also useful when we know column positions
## but not necessarily names
SEMSummary(~ ., data = mtcars[, c(1, 2, 3, 9, 10, 11)])
## clean up
rm(s)
#' # sample data
Xmiss <- as.matrix(iris[, -5])
# make 25% missing completely at random
set.seed(10)
Xmiss[sample(length(Xmiss), length(Xmiss) * .25)] <- NA
Xmiss <- as.data.frame(Xmiss)
SEMSummary(~ ., data = Xmiss, use = "fiml")
## clean up
rm(Xmiss)
# }
Run the code above in your browser using DataLab