# Sunthud Pornprasertmanit

## Postdoc Research Associate, IMMAP, Texas Tech University

# Measurement Invariance for Categorical Indicators

This page contains the example codes for measurement invariance using categorical indicators. I provide the examples using Mplus and lavaan. All of the scripts here are based on theta parameterization, which is highly recommended for the 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, there are eight 5-point Likert indicators which are equally loaded by two factors. The data are seperated into two groups (Male vs. Female). The second data set is the same as the first data set but items are dichotomous.

The codes here are created by following the Millsap and Yun-Tein's (2004) guideline. The codes in this page assumes that the hypothesized model is congeneric factor model. In other words, there are no cross loadings and no measurement error correlations. Users are referred to the article if 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 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 are equally constrained across groups. One additional thresholds of the marker variable are equally constrained across groups. Other thresholds are free. In other words, two thresholds are constrained in marker variables and one threshold are constrained in other variables.
- The unique variances of the first group are fixed as 1. The unique variances of other groups are freely estimated.
- The factor covariance matrices (variances and covariances) of all groups 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 configural invariance model. The weak invariance can be estiblished by constraining all free loadings to be equal across groups. The strong invariance can be established 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, 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 | 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

This 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 highly recommend researchers to go through the manual way first 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.
- The factor covariance matrices (variances and covariances) of all groups 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 configural invariance model. The weak invariance can be estiblished 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 highly recommend researchers to go through the manual way first to understand the process behind the function. Then, you may compare your results with the results from the **measurementInvarainceCat** function.