# In gabriellajg/equaltestMI: Measurement Invariance via Equivalence Testing and Projection Method

## Introduction

The supplementary materials illustrate the use of the accompanying R package equaltestMI. The sample statistics from Table 1 of Lee and Al Otaiba (2015) are used as an example. The description of the data can be found in the original article and the results obtained from equaltestMI are discussed at length in the published article “Advances in Measurement Invariance and Mean Comparison of Latent Variables: Equivalence Testing and A Projection-Based Approach” .

The R package equaltestMI is available on CRAN and can be downloaded for use on any R platform with version higher than 3.1.0. Users can pass different arguments to the main function eqMI.main() to examine measurement invariance using the conventional multiple-group approach or equivalence testing approach. Under the framework of equivalence testing, users obtain the minimum tolerable size (T-size) and adjusted cutoff values to evaluate the goodness-of-fit of each invariance test. The projection method is also available for testing the equality of latent means.

## Important Notes:

This package is developed for complete dataset with two groups/time points. Use of saturated models might lead to problems in calculation of adjusted RMSEA thresholds. Please consider alternative methods if you have datasets that do not satisfy the requirements.

\newline

## Part 1: R Script for Obtaining Results from Equivalence Testing and Projection Method

```## load package
# install.packages("equaltestMI")
# library(equaltestMI)

# install.packages("devtools")
library(devtools)
devtools::install_github("gabriellajg/equaltestMI", force=TRUE)
library(equaltestMI)
```

\newline

```## sample statistics where M1 and M2 are sample means, and Cov1 and Cov2 are sample covariance matrices;

#setwd("C:/research/equaltestMI")
Group1 <- as.matrix(Group1)
Group2 <- as.matrix(Group2)
M1 <- Group1[1,]
M2 <- Group2[1,]
Cov1 <- Group1[2:7,]
Cov2 <- Group2[2:7,]
```
```## lavaan model syntax
model <- '
AlphabetKnowledge =~ Letter_Name+ Letter_Sound
PhonologicalAwareness =~ Blending + Elision
Spelling =~ Real_Words + Pseudo_Words
'
```

\newline

```## the results using equivalence testing and projection method
## full R output will be presented in Part 3

test <- eqMI.main(model = model,
sample.nobs = c(78, 174),
sample.mean = list(M1, M2),
sample.cov = list(Cov1, Cov2),
meanstructure = TRUE,
output = 'both',
quiet = FALSE,
equivalence.test = TRUE, adjRMSEA = TRUE,
projection = TRUE, bootstrap = FALSE)
```

\newline

## Part 2: Sample Means and Covariance Matrices of the Example Data

Sample means:

```M1
```

Sample Covariance Matrix:

```round(Cov1, 3)
```

\newline

Sample means:

```M2
```

Sample Covariance Matrix:

```round(Cov2, 3)
```

\newline

## Part 3: Full R Output of the “test” object in Part 1

```## the results using equivalence testing and projection method
test <- eqMI.main(model = model,
sample.nobs = c(78, 174),
sample.mean = list(M1, M2),
sample.cov = list(Cov1, Cov2),
meanstructure = TRUE,
output = 'both',
quiet = FALSE,
equivalence.test = TRUE, adjRMSEA = TRUE,
projection = TRUE, bootstrap = FALSE)
```

\newline

## Part 4: Some Commonly Performed Analysis

1. results using conventional multiple-group SEM approach:
```test1 <- eqMI.main(model = model,
sample.nobs = c(78, 174), sample.cov = list(Cov1, Cov2),
sample.mean = list(M1, M2), meanstructure = TRUE,
equivalence.test = FALSE, adjRMSEA = FALSE)
```
1. results using conventional multiple-group SEM approach with mean structure tested by projection method:
```test2 <- eqMI.main(model = model,
sample.nobs = c(78, 174), sample.cov = list(Cov1, Cov2),
sample.mean = list(M1, M2), meanstructure = TRUE,
equivalence.test = FALSE, adjRMSEA = FALSE,
projection = TRUE)
```
1. results using equivalence testing:
```test3 <- eqMI.main(model = model,
sample.nobs = c(78, 174), sample.cov = list(Cov1, Cov2),
sample.mean = list(M1, M2), meanstructure = TRUE,
equivalence.test = TRUE, adjRMSEA = FALSE)
```
1. results using equivalence testing and adjusted cutoff values:
```test4 <- eqMI.main(model = model,
sample.nobs = c(78, 174), sample.cov = list(Cov1, Cov2),
sample.mean = list(M1, M2), meanstructure = TRUE,
equivalence.test = TRUE, adjRMSEA = TRUE)
```
1. analysis of 4 with mean structure tested by projection method:
```test5 <- eqMI.main(model = model,
sample.nobs = c(78, 174), sample.cov = list(Cov1, Cov2),
sample.mean = list(M1, M2), meanstructure = TRUE,
equivalence.test = TRUE, adjRMSEA = TRUE,
projection = TRUE)
```
1. if any of the tests above evaluate only mean structure or only covariance structure, add the argument "structure = 'mean'" or "structure = 'covariance'", say test5 with only mean structure:
```test6 <- eqMI.main(model = model, structure = 'mean',
sample.nobs = c(78, 174), sample.cov = list(Cov1, Cov2),
sample.mean = list(M1, M2), meanstructure = TRUE,
equivalence.test = TRUE, adjRMSEA = TRUE,
projection = TRUE)
```
1. if raw data are available, say the name of the raw data is 'literacy.dat' and the variable of group membership is 'FRL', then test5 is conducted as:
```test7 <- eqMI.main(model = model, data = literacy.dat,
group = "FRL", meanstructure = TRUE,
equivalence.test = TRUE, adjRMSEA = TRUE,
projection = TRUE)
```
1. when raw data are available and project method is used, bootstrap resampling can be used to obtain empirical p-values of the tests conducted by project method by enabling bootstrap = TRUE.
```#test8 <- eqMI.main(model = model, data = literacy.dat,
#   group = "FRL", meanstructure = TRUE,
#   equivalence.test = TRUE, adjRMSEA = TRUE,
#   projection = TRUE, bootstrap = TRUE)
```
1. in any of the tests above, the users can suppress the printing of results (not recommended) though the results are still contained in test9\$eqMI.stat:
```test9 <- eqMI.main(model = model, data = literacy.dat,
group = "FRL", meanstructure = TRUE,
equivalence.test = TRUE, adjRMSEA = TRUE,
projection = TRUE, bootstrap = FALSE,
quite = TRUE)
```
1. in any of the tests above, the users can allow partial invariance by adding 'group.partial':
```test10 <- eqMI.main(model = model, data = literacy.dat,
group = "FRL", meanstructure = TRUE,
group.partial = c("Spelling=~Real_Words", "Blending~1"),
equivalence.test = TRUE, adjRMSEA = TRUE,
projection = TRUE)
```

so that the loadings of 'Spelling' on 'Real_Words' and the intercept of 'Blending' are allowed to vary across groups.

\newline

## Part 5: Arguments of the eqMI.main() Function

\newline

```# For a complete view of the help page of function eqMI.main(), please install R package printr
library(printr)
?eqMI.main
```

gabriellajg/equaltestMI documentation built on Oct. 2, 2018, 8:11 a.m.