View source: R/lavaan_indicator_order.R
lavaan_indicator_order | R Documentation |
Determine the order of indicators and match indicators and factors based on a 'lavaan' model syntax.
lavaan_indicator_order(model_syntax)
model_syntax |
A string that
should be a model specified in
|
It generates a named vector
for the argument indicator_order
of set_cfa_layout()
and
set_sem_layout()
using a lavaan
model syntax.
A variable is considered an indicator
if it is on the right-hand side
of the operator =~
.
If an indicator loaded on more than one latent variable, it will only be matched to one of them, determined by the order of appearance in the internal storage.
A named character vector. The values are the indicators in the model syntax. The names are the latent factors the indicators loaded on.
set_sem_layout()
and
set_cfa_layout()
.
mod <-
'f1 =~ x01 + x02 + x03 + x06
f4 =~ x11 + x12 + x13 + x14
f2 =~ x04 + x05 + x06 + x07
f3 =~ x08 + x09 + x10 + x03
'
lavaan_indicator_order(mod)
mod <-
'f1 =~ x01 + x02 + x03 + x06
f3 =~ x08 + x09 + x10 + x03
f2 =~ x04 + x05 + x06 + x07
f4 =~ x11 + x12 + x13 + x14
f3 ~ f1 + f2
f4 ~ f3
'
lavaan_indicator_order(mod)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.