---
title: "Looking for Invariance in CFA models"
author: "Doug Hemken"
date: "October 2015"
---
```{r setup, echo=FALSE, message=FALSE}
source("../StataMDsetup.r")
```

# Comparing Measurement Models

Using the MPlus example data:

```{r congeneric, collectcode=TRUE}
* Data for a two factor measurement model
infile x1-x6 using "Z:\PUBLIC_WEB\MPlus\Basics\CFA and MIMIC\ex5.1.dat"

// The congeneric model, where everything varies
sem (L1 -> x1-x3)
estimates store congeneric
```

And some example output:

```{r taueq}
// Tau-equivalent, all loadings equal
//  a unit change on one measure is equal to that on another
sem (L1@a -> x1-x3)
// also written (L1 -> x1@a x2@a x3@a), or as three separate paths
estimates store tauequivalent
lrtest tauequivalent congeneric
```


```{r, engine='R', echo=FALSE, message=FALSE}
  unlink("profile.do")
```