Compute the measurement invariance model (i.e., measurement equivalence model) using multi-group confirmatory factor analysis (MGCFA; Jöreskog, 1971). This function uses the lavaan::cfa() in the backend.
Users can run the configural-metric or the configural-metric-scalar comparisons (see below for detail instruction).
All arguments (except the CFA items) must be explicitly named (like model = your-model; see example for inappropriate behavior).
measurement_invariance(
data,
...,
model = NULL,
group,
ordered = FALSE,
group_partial = NULL,
invariance_level = "scalar",
estimator = "ML",
digits = 3,
quite = FALSE,
streamline = FALSE,
return_result = FALSE
)
data.frame
CFA items. Multi-factor CFA items should be separated by comma (as different argument). See below for examples. Support dplyr::select()
syntax.
explicit lavaan
model. Must be specify with model = lavaan_model_syntax
.
the nested variable for multilevel dataset (e.g., Country). Support dplyr::select()
syntax.
Default is FALSE
. If it is set to TRUE
, lavaan
will treat it as a ordinal variable and use DWLS
instead of ML
items for partial equivalence. The form should be c('DV =~ item1', 'DV =~ item2'). See details for recommended practice.
"metric" or "scalar". Default is 'metric'. Set as 'metric' for configural-metric comparison, and set as 'scalar' for configural-metric-scalar comparison.
estimator for lavaan. Default is ML
number of digits to round to
suppress printing output except the model summary.
print streamlined output
If it is set to TRUE
, it will return a data frame of the fit measure summary
a data.frame
of the fit measure summary
Chen (2007) suggested that change in CFI <= |-0.010| supplemented by RMSEA <= 0.015 indicate non-invariance when sample sizes were equal across groups and larger than 300 in each group (Chen, 2007). And, Chen (2007) suggested that change in CFI <= |-0.005| and change in RMSEA <= 0.010 for unequal sample size with each group smaller than 300. For SRMR, Chen (2007) recommend change in SRMR < 0.030 for metric-invariance and change in SRMR < 0.015 for scalar-invariance. For large group size, Rutowski & Svetina (2014) recommended a more liberal cut-off for metric non-invariance for CFI (change in CFI <= |-0.020|) and RMSEA (RMSEA <= 0.030). However, this more liberal cut-off DOES NOT apply to testing scalar non-invariance. If measurement-invariance is not achieved, some researchers suggesting partial invariance is acceptable (by releasing the constraints on some factors). For example, Steenkamp and Baumgartner (1998) suggested that ideally more than half of items on a factor should be invariant. However, it is important to note that no empirical studies were cited to support the partial invariance guideline (Putnick & Bornstein, 2016).
Chen, F. F. (2007). Sensitivity of Goodness of Fit Indexes to Lack of Measurement Invariance. Structural Equation Modeling: A Multidisciplinary Journal, 14(3), 464–504. https://doi.org/10.1080/10705510701301834
Jöreskog, K. G. (1971). Simultaneous factor analysis in several populations. Psychometrika, 36(4), 409-426.
Putnick, D. L., & Bornstein, M. H. (2016). Measurement Invariance Conventions and Reporting: The State of the Art and Future Directions for Psychological Research. Developmental Review: DR, 41, 71–90. https://doi.org/10.1016/j.dr.2016.06.004
Rutkowski, L., & Svetina, D. (2014). Assessing the Hypothesis of Measurement Invariance in the Context of Large-Scale International Surveys. Educational and Psychological Measurement, 74(1), 31–57. https://doi.org/10.1177/0013164413498257
Steenkamp, J.-B. E. M., & Baumgartner, H. (n.d.). Assessing Measurement Invariance in Cross-National Consumer Research. JOURNAL OF CONSUMER RESEARCH, 13.
# REMEMBER, YOU MUST NAMED ALL ARGUMENT EXCEPT THE CFA ITEMS ARGUMENT
# Fitting a multiple-factor measurement invariance model by passing items.
measurement_invariance(
x1:x3,
x4:x6,
x7:x9,
data = lavaan::HolzingerSwineford1939,
group = "school",
invariance_level = "scalar" # you can change this to metric
)
#> Computing CFA using:
#> DV1 =~ x1 + x2 + x3
#> DV2 =~ x4 + x5 + x6
#> DV3 =~ x7 + x8 + x9
#> [1] "Computing for configural model"
#> [1] "Computing for metric model"
#> [1] "Computing for scalar model"
#>
#> Model Summary
#> Model Type = Measurement Invariance
#> Comparsion Type = Configural-Metric-Scalar Comparsion
#> Group = school
#> Model Formula =
#> . DV1 =~ x1 + x2 + x3
#> DV2 =~ x4 + x5 + x6
#> DV3 =~ x7 + x8 + x9
#>
#>
#> Fit Measure Summary
#> ──────────────────────────────────────────────────────────────────────────────────────────────────────────
#> Analysis Type Χ² DF P CFI RMSEA SRMR TLI AIC BIC BIC2
#> ──────────────────────────────────────────────────────────────────────────────────────────────────────────
#> configural 115.851 48.000 0.000 *** 0.923 0.097 0.068 0.885 7484.395 7706.822 7516.536
#> metric 124.044 54.000 0.000 *** 0.921 0.093 0.072 0.895 7480.587 7680.771 7509.514
#> scalar 164.103 60.000 0.000 *** 0.882 0.107 0.082 0.859 7508.647 7686.588 7534.359
#> .
#> metric - config 8.192 6.000 0.000 *** -0.002 -0.004 0.004 0.009 -3.808 -26.050 -7.022
#> scalar - metric 40.059 6.000 0.000 *** -0.038 0.015 0.011 -0.036 28.059 5.817 24.845
#> ──────────────────────────────────────────────────────────────────────────────────────────────────────────
#> *** p < 0.001, ** p < 0.01, * p < 0.05, + p < 0.1
#> You can drag and resize the R console to view the entire table
#>
#> Goodness of Fit:
#> OK. Excellent measurement metric-invariance based on |ΔCFI| < 0.005
#> OK. Excellent measurement metric-invariance based on |ΔRMSEA| < 0.01
#> OK. Good measurement metric-invariance based on ΔSRMR < 0.03
#> Warning. Unacceptable measurement scalar-invariance based on |ΔCFI| > 0.01
#> Warning. Unacceptable measurement scalar-invariance based on |ΔRMSEA| > 0.015.
#> OK. Good measurement scalar-invariance based on ΔSRMR < 0.015
# Fitting measurement invariance model by passing explicit lavaan model
# I am also going to only test for metric invariance instead of the default scalar invariance
# \donttest{
measurement_invariance(
model = "visual =~ x1 + x2 + x3;
textual =~ x4 + x5 + x6;
speed =~ x7 + x8 + x9",
data = lavaan::HolzingerSwineford1939,
group = "school",
invariance_level = "metric"
)
#> Computing CFA using:
#> visual =~ x1 + x2 + x3;
#> textual =~ x4 + x5 + x6;
#> speed =~ x7 + x8 + x9[1] "Computing for configural model"
#> [1] "Computing for metric model"
#>
#> Model Summary
#> Model Type = Measurement Invariance
#> Comparsion Type = Configural-Metric Comparsion
#> Group = school
#> Model Formula =
#> .visual =~ x1 + x2 + x3;
#> textual =~ x4 + x5 + x6;
#> speed =~ x7 + x8 + x9
#>
#> Fit Measure Summary
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────
#> Analysis Type Χ² DF P CFI RMSEA SRMR TLI AIC BIC BIC2
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────
#> configural 115.851 48.000 0.000 *** 0.923 0.097 0.068 0.885 7484.395 7706.822 7516.536
#> metric 124.044 54.000 0.000 *** 0.921 0.093 0.072 0.895 7480.587 7680.771 7509.514
#> .
#> metric - config 8.192 6.000 0.000 *** -0.002 -0.004 0.004 0.009 -3.808 -26.050 -7.022
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────
#> *** p < 0.001, ** p < 0.01, * p < 0.05, + p < 0.1
#> You can drag and resize the R console to view the entire table
#>
#> Goodness of Fit:
#> OK. Excellent measurement metric-invariance based on |ΔCFI| < 0.005
#> OK. Excellent measurement metric-invariance based on |ΔRMSEA| < 0.01
#> OK. Good measurement metric-invariance based on ΔSRMR < 0.03
# }
if (FALSE) { # \dontrun{
# This will fail because I did not add `model = ` in front of the lavaan model.
# Therefore,you must add the tag in front of all arguments
# For example, `return_result = 'model'` instaed of `model`
measurement_invariance(
"visual =~ x1 + x2 + x3;
textual =~ x4 + x5 + x6;
speed =~ x7 + x8 + x9",
data = lavaan::HolzingerSwineford1939
)
} # }