Measurement Invariance for Categorical Indicators
This page contains the example codes for measurement invariance using categorical indicators. I provide examples using Mplus and lavaan. All of the scripts here are based on theta parameterization, which is highly recommended for measurement invariance. Note that the results from Mplus and lavaan are slightly different.
There are two sets of examples here. In the first data set, eight 5-point Likert indicators are equally loaded by two factors. The data are separated into two groups (Male vs. Female). The second data set is the same as the first, but the items are dichotomous.
The syntaxes are created following Millsap and Yun-Tein's (2004) guidelines. This page's syntax assumes that the hypothesized model is a congeneric factor model. In other words, there are no cross-loadings and no measurement error correlations. Users are referred to the article if a complex factor structure is used.
Note that the diagonal weighted least square estimator (e.g., WLSMV) is used. Therefore, the regular chi-square difference test cannot be used. In Mplus, the DIFFTEST feature should be used to conduct a chi-square difference test.
Likert items (more than 2 response outcomes)
For Likert items, the following specification is needed to set the scale identification:
- For each factor, the factor loading of one marker variable is fixed (usually as 1). Other factor loadings are freely estimated across groups.
- One threshold of each variable is equally constrained across groups. One additional threshold of the marker variable is equally constrained across groups. Other thresholds are free. In other words, two thresholds are constrained in marker variables, and one is constrained in other variables.
- The unique variances of the first group are fixed as 1. The unique variances of other groups are freely estimated.
- All groups' factor covariance matrices (variances and covariances) are freely estimated.
- The factor means of the first group are fixed as 0. The factor means of the other groups are freely estimated.
From here, we have a configural invariance model. The weak invariance can be established by constraining all free loadings to be equal across groups. The strong invariance can be found by constraining all free thresholds to be equal across groups. The strict invariance can be established by constraining all unique variances of all indicators to be equal across groups. Because the unique variances of the first group are fixed to 1 for scale identification, strict invariance can be established by fixing all unique variances of all groups to 1.
Files
Mplus
All files in this example are available here. Here are the details of each file:
Model | Input | Output | Chi-squares for DIFFTEST |
---|---|---|---|
Configural | configural5c.inp | configural5c.out | configural5c.dif |
Weak | weak5c.inp | weak5c.out | weak5c.dif |
Strong | strong5c.inp | strong5c.out | strong5c.dif |
Strict | strict5c.inp | strict5c.out | strict5c.dif |
Here is the link to the dataset: example5c.csv
lavaan
The following scripts require analysts to specify the hierarchy of models manually.
- Script: catInvariance5.R
- Dataset: example5c.csv
Alternatively, the semTools package provides the measurementInvarainceCat function to automatically compare different levels of constraints. I recommend researchers go through the manual to understand the process behind the function. Then, you may compare your results with the results from the measurementInvarainceCat function.
Dichotomous Items
For dichotomous items, the following specification is needed to set the scale identification:
- For each factor, the factor loading of one marker variable is fixed (usually as 1). Other factor loadings are freely estimated across groups.
- All thresholds are equally constrained across groups.
- The unique variances of the first group are fixed as 1. The unique variances of other groups are freely estimated, except that the unique variances of the marker variables are fixed as 1.
- All groups' factor covariance matrices (variances and covariances) are free.
- The factor means of the first group are fixed as 0. The factor means of the other groups are freely estimated.
From here, we have a configural invariance model. The weak invariance can be established by constraining all free loadings to be equal across groups. The strong invariance cannot be established because the thresholds in the configural invariance model are all equally constrained to set the scale. The strict invariance can be established by fixing all unique variances of all groups to be 1.
Files
Mplus
All files in this example are available here. Here are the details of each file:
Model | Input | Output | Chi-squares for DIFFTEST |
---|---|---|---|
Configural | configural2c.inp | configural2c.out | configural2c.dif |
Weak | weak2c.inp | weak2c.out | weak2c.dif |
Strict | strict2c.inp | strict2c.out | strict2c.dif |
Here is the link to the dataset: example2c.csv
lavaan
This following scripts require analysts to specify the hierarchy of models manually.
- Script: catInvariance2.R
- Dataset: example2c.csv
Alternatively, the semTools package provides the measurementInvarainceCat function to automatically compare different levels of constraints. I recommend researchers go through the manual to understand the process behind the function. Then, you may compare your results with the results from the measurementInvarainceCat function.