View source: R/subsem_userfun.R
subsem_lrt | R Documentation |
todo
subsem_lrt(
model,
data,
predictors = NULL,
group = NULL,
subsem_options = list(),
lavaan_options = list()
)
model |
a lavaan model syntax (a character vector) |
data |
a data frame |
predictors |
a character vector of variable names, which are used as covariates/predictors in the subgroup discovery (variables in data) |
group |
An additional group variable for subgroup discovery in multigroup models. |
subsem_options |
A list of additional options passed to the subgroupsem main function |
lavaan_options |
A list of additional options passed to the lavaan main function |
# Define lavaan model
model <- "
eta1 =~ NA*x1 + x2 + x3
eta2 =~ NA*x4 + x5 + x6
eta3 =~ NA*x7 + x8 + x9
eta1 ~~ 1*eta1
eta2 ~~ 1*eta2
eta3 ~~ 1*eta3
eta1 + eta2 + eta3 ~ 0*1
"
# Pass model, data and names of predictors to function
m1 <- subsem_lrt(
model = model,
data = lavaan::HolzingerSwineford1939,
predictors = c("sex", "school", "grade")
)
summary(m1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.