measurement_invariance_models {modelbpp} | R Documentation |
Measurement Invariance Models
Description
Generate metric and scalar invariance models and their partial invariance versions.
Usage
measurement_invariance_models(
cfa_out,
max_free = 1,
metric = TRUE,
scalar = TRUE,
progress = TRUE
)
Arguments
cfa_out |
The output of
|
max_free |
The maximum number of constraints to be released when generating the partial invariance models. For example, if set to 1, then only the partial metric invariance model only has at most one item allowed to have different loadings across group. Default is 1. If set to zero, then no partial invariance models will be generated. |
metric |
Logical. If |
scalar |
Logical. If |
progress |
Logical. If |
Details
This a helper function to generate, based on a multigroup confirmatory factor analysis (CFA) model with no between-group equality constraints, the following models:
A metric invariance model (loadings constrained to be equal across groups).
A scalar invariance model (intercepts and loadings constrained to be equal across groups).
Partial invariance versions of the previous two models, such as a model with the loadings of all items, except for one, constrained to be equal across groups.
The models generated can then be used
in model_set()
to compute BPPs.
Requirements
The model used as the input needs to be fitted with no between group constrains, that is, it is a configural invariance model. Although not a must, it is advised to use the default way to identify each factor (that is, fixing a loading to one).
Implementation
This function simply use the
group.partial
and group.equal
argument of lavaan::cfa()
to
generate the models.
Value
A list of lavaan::cfa()
output. The names are automatically
generated to indicate whether a model
is configural, metric, or scalar
invariance, or the item(s) without
between-group constraints on the
loadings (for partial metric
invariance) or intercepts (for
partial scalar invariance).
Author(s)
Shu Fai Cheung https://orcid.org/0000-0002-9871-9448
See Also
Examples
library(lavaan)
# For illustration, only one factor is used,
# with one item from another factor added
# just to make the model not saturated.
HSmod <-
"
spatial =~ x1 + x2 + x3 + x4
"
fit_config <- cfa(model = HSmod,
data = HolzingerSwineford1939,
group = "school")
fit_mi <- measurement_invariance_models(fit_config)
names(fit_mi)
# Need to add 'skip_check_sem_out = TRUE' to use multigroup models.
out <- model_set(sem_out = fit_mi,
skip_check_sem_out = TRUE,
progress = FALSE,
parallel = FALSE)
print(out)