View source: R/subsem_userfun.R
subsem | R Documentation |
todo
subsem(
model,
data,
qf = NULL,
predictors = NULL,
group = NULL,
subsem_options = list(),
lavaan_options = list()
)
model |
a lavaan model syntax (a character vector) |
data |
a data frame |
qf |
a lavaan syntax-based computation of the interestingness measure, where the interestingness measure has to be named *subsem_qf*. Can also be included directly in the model syntax (then, here NULL, as is default) |
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 |
List containing the time consumed and the groups.
# Define lavaan model
model <- "
eta1 =~ NA*x1 + c(la21,la22)*x2 + x3
eta2 =~ NA*x4 + c(la51,la52)*x5 + x6
eta3 =~ NA*x7 + c(la81,la82)*x8 + x9
eta1 ~~ 1*eta1
eta2 ~~ 1*eta2
eta3 ~~ 1*eta3
eta1 + eta2 + eta3 ~ 0*1
subsem_qf := abs(la21 - la22)
"
# Pass model, data and names of predictors to function
m1 <- subsem(
model = model,
data = lavaan::HolzingerSwineford1939,
qf = NULL,
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.