Jason's main page

Longitudinal Structural Equation Modeling: A Comprehensive Introduction, Second Edition

Jason T. Newsom

Portland State University

 

 

 

 

 

 

Routledge.com

Amazon.com

 

Go to first edition

 

Corrections and clarifications (2nd ed)

 

Syntax and data sets

In Mplus, locate data in the same folder as the input file. For the R package lavaan, locate data in the same folder as the script file and use rstudioapi package code included to set default working directory location for the data to be the same location as that of the script file, or omit the rstudioapi code and use the file location path to read the data files from the online location or your local drive location.

 

Chapter

Data Sets

Mplus

lavaan

All chapters

lsem2data.zip

lsem2mplus.zip

lsemr.zip

1 Review of some key latent variable principles

socex1.dat

ex1-1a.inp

ex1-1b.inp

ex1-2a.inp

ex1-2b.inp

ex1-2c.inp

ex1-3a.inp

ex1-3b.inp

ex1-3c.inp

ex1-3d.inp

ex1-1a.R

ex1-1b.R

ex1-2a.R

ex1-2b.R

ex1-2c.R

ex1-3c.R

 

2 Longitudinal measurement invariance

 

Excel sheet for computing DNCI and Cohen’s w:

NCI.xlsx

socex1.dat

ex2-1.inp

ex2-2a.inp

ex2-2b.inp

ex2-2c.inp

ex2-3.inp

ex2-4a.inp

ex2-4b.inp

ex2-5a.inp

ex2-5b.inp

ex2-6.inp

ex2-7.inp

ex2-8a.inp

ex2-8b.inp

ex2-9.inp

ex2-1.R

ex2-2a.R

ex2-2b.R

ex2-2c.R

ex2-3.R

ex2-4a.R

ex2-5a.R

ex2-5b.R

ex2-6.R

ex2-7.R

ex2-8a.R

ex2-9.R

 

3 Structural models for comparing dependent means and proportions

socex1.dat

ex3-1.inp

ex3-1a.inp

ex3-1b.inp

ex3-1c.inp

ex3-1d.inp

ex3-2.inp

ex3-3a.inp

ex3-3b.inp

ex3-3c.inp

ex3-4a.inp

ex3-4b.inp

ex3-4c.inp

ex3-4d.inp

ex3-5a.inp

ex3-5b.inp

ex3-5c.inp

ex3-5d.inp

ex3-5e.inp

ex3-5f.inp

ex3-6a.inp

ex3-7a.inp

ex3-1.R

ex3-1a.R

ex3-1b.R

ex3-1c.R

ex3-1d.R

ex3-3a.R

ex3-3b.R

ex3-3c.R

ex3-4a.R

ex3-4b.R

ex3-4c.R

ex3-4d.R

ex3-5a.R

ex3-5c.R

ex3-5d.R

ex3-5e.R

ex3-5f.R

ex3-7c.R

ex3-7d.R

ex3-7e.R

 

4 Fundamental concepts of stability and change

socex1.dat

ex4-1.inp

ex4-2a.inp

ex4-2b.inp

ex4-4.inp

ex4-5a.inp

ex4-5b.inp

ex4-6.inp

ex4-7a.inp

ex4-7b.inp

ex4-8.inp

ex4-1.R

ex4-2b.R

ex4-4.R

ex4-5a.R

ex4-5b.R

ex4-6.R

ex4-7a.R

ex4-7b.R

ex4-8.R

5 Cross-lagged panel models

socex1.dat

healh.dat

ex5-1.inp

ex5-2a.inp

ex5-2b.inp

ex5-2c.inp

ex5-3a.inp

ex5-3b.inp

ex5-4.inp

ex5-5a.inp

ex5-5b.inp

ex5-6a.inp

ex5-6b.inp

ex5-6c.inp

ex5-7.inp

ex5-8a.inp

ex5-8b.inp

ex5-1.R

ex5-2a.R

ex5-2b.R

ex5-2c.R

ex5-3a.R

ex5-3b.R

ex5-4.R

ex5-5a.R

ex5-5b.R

ex5-6a.R

ex5-6b.R

ex5-6c.R

ex5-7.R

ex5-8a.R

ex5-8b.R

6 Latent state-trait models

health.dat

socex1.dat

ex6-1a.inp

ex6-1b.inp

ex6-1c.inp

ex6-1d.inp

ex6-1e.inp

ex6-2.inp

ex6-3a.inp

ex6-3b.inp

ex6-3c.inp

ex6-4a.inp

ex6-4b.inp

ex6-4c.inp

ex6-4d.inp

Coming soon please see first edition examples for now

7 Linear latent growth curve models

health.dat

ex7-1a.inp

ex7-1b.inp

ex7-1c.inp

ex7-2a.inp

ex7-2b.inp

ex7-3a.inp

ex7-3b.inp

ex7-3c.inp

ex7-4.inp

ex7-5a.inp

ex7-5b.inp

ex7-6a.inp

ex7-6b.inp

ex7-6c.inp

 

8 Nonlinear latent growth curve models

health.dat

ex8-1a.inp

ex8-1b.inp

ex8-1c.inp

ex8-2a.inp

ex8-2b.inp

ex8-2c.inp

ex8-2d.inp

ex8-3a.inp

ex8-3b.inp

ex8-4.inp

ex8-5a.inp

ex8-5b.inp

ex8-5c.inp

 

9 Latent difference score models

health.dat

ex9-1.inp

ex9-2.inp

ex9-3.inp

ex9-4.inp

ex9-5a.inp

ex9-5b.inp

ex9-6.inp

 

10 Latent transition and growth mixture models

socex1.dat

health.dat

ex10-1a.inp

ex10-1b.inp

ex10-2a.inp

ex10-2b.inp

ex10-3a.inp

ex10-3b.inp

ex10-3c.inp

ex10-4a.inp

ex10-4b.inp

ex10-5.inp

 

11 Growth mixture models

health.dat

ex11-1.inp

ex11-2.inp

ex11-3.inp

 

12 Time series models

diabetes.dat

consumer.dat

diabetes2.dat

ex12-1a.inp

ex12-1b.inp

ex12-1c.inp

ex12-2.inp

ex12-3.inp

ex12-4.inp

ex12-5.inp

ex12-6.inp

ex12-7.inp

ex12-8.inp

ex12-9.inp

 

13 Survival analysis models

health survival.dat

socex2.dat

ex13-2a.inp

ex13-2b.inp

ex13-2c.inp

ex13-2d.inp

ex13-3a.inp

ex13-3b.inp

 

14 Missing data and attrition

health missing.dat

ex14-1a.inp

ex14-1b.inp

ex14-1c.inp

ex14-2a.inp

ex14-2b.inp

ex14-2c.inp

ex14-3a.inp

ex14-3b.inp

ex14-4a.inp

ex14-4b.inp

ex14-4c.inp

ex14-5.inp

ex14-6a.inp

ex14-6b.inp

 

 

Data files contain the same data sets used in the text (many of the data sets are used in more than one chapter). Data were simulated to closely correspond with the mean, variances, and covariances of several real data sets. See Example Data Sets at the front of the book for additional information. Syntax files were developed using Mplus versions 8.9 and the lavaan R package versions 0.6-16.  All examples in the text are represented here. When variations on a particular model involve imposing constraints, only one example is given and notes on how to test the model variation are made in comments in the syntax.  Examples in lavaan code are provided where current features allow. Binary ML and latent class analysis examples are only available in Mplus, for example.  Thanks to Amanuel Melekin (Zimam) for help translating Mplus code to lavaan for the first edition.

 

 

 

Longitudinal Structural Equation Modeling : A Comprehensive Introduction

Jason T. Newsom

Portland State University

 

 

 

 

 

 

 

Routledge website for the book

at Amazon.com

 

Corrections and clarifications

 

Syntax and data sets

In Mplus, locate data in the same folder as the syntax/input file. In lavaan, replace <your director path> with the location of your data file in the working directory command. For example, setwd("c:/analyses/lsem"). Before using lavaan for the first time on any computer, you will need to run the following line: install.packages("lavaan", dependencies=TRUE)

 

Chapter

Data Sets

Mplus

lavaan

All chapters

lsemdata.zip

lsemmplus.zip

lsemr.zip

1 Review of some key latent variable principles

socex1.dat

ex1-1.inp

ex1-1a.inp

ex1-1b.inp

ex1-2a.inp

ex1-2b.inp

ex1-2c.inp

ex1-3a.inp

ex1-3b.inp

ex1-3c.inp

ex1-3d.inp

ex1-1.R

ex1-1a.R

ex1-1b.R

ex1-2a.R

ex1-2b.R

ex1-2c.R

ex1-3c.R

 

2 Longitudinal measurement invariance

socex1.dat

ex2-1.inp

ex2-2a.inp

ex2-2b.inp

ex2-2c.inp

ex2-3.inp

ex2-4a.inp

ex2-4b.inp

ex2-5a.inp

ex2-5b.inp

ex2-6.inp

ex2-7.inp

ex2-8a.inp

ex2-8b.inp

ex2-9.inp

ex2-1.R

ex2-2a.R

ex2-2b.R

ex2-2c.R

ex2-3.R

ex2-4a.R

ex2-5a.R

ex2-5b.R

ex2-6.R

ex2-7.R

ex2-8a.R

ex2-9.R

 

3 Structural models for comparing dependent means and proportions

socex1.dat

ex3-1.inp

ex3-1a.inp

ex3-1b.inp

ex3-1c.inp

ex3-1d.inp

ex3-2.inp

ex3-3a.inp

ex3-3b.inp

ex3-3c.inp

ex3-4a.inp

ex3-4b.inp

ex3-4c.inp

ex3-4d.inp

ex3-5a.inp

ex3-5b.inp

ex3-5c.inp

ex3-5d.inp

ex3-5e.inp

ex3-5f.inp

ex3-5g.inp

ex3-5h.inp

ex3-5i.inp

ex3-6a.inp

ex3-7a.inp

ex3-7b.inp

ex3-7c.inp

ex3-7d.inp

ex3-7e.inp

ex3-7f.inp

ex3-7g.inp

ex3-1.R

ex3-1a.R

ex3-1b.R

ex3-1c.R

ex3-1d.R

ex3-3a.R

ex3-3b.R

ex3-3c.R

ex3-4b.R

ex3-4c.R

ex3-4d.R

ex3-5a.R

ex3-5c.R

ex3-5d.R

ex3-5e.R

ex3-5f.R

ex3-5g.R

ex3-5h.R

ex3-7c.R

ex3-7d.R

ex3-7e.R

ex3-7g.R

 

4 Fundamental concepts of stability and change

socex1.dat

ex4-1.inp

ex4-2a.inp

ex4-2b.inp

ex4-4.inp

ex4-5a.inp

ex4-5b.inp

ex4-5c.inp

ex4-6.inp

ex4-7a.inp

ex4-7b.inp

ex4-8a.inp

ex4-4.R

ex4-7a.R

ex4-7b.R

5 Cross-lagged panel models

socex1.dat

healh.dat

ex5-1a.inp

ex5-2a.inp

ex5-2b.inp

ex5-2c.inp

ex5-3.inp

ex5-3a.inp

ex5-3b.inp

ex5-4.inp

ex5-4a.inp

ex5-4b.inp

ex5-4c.inp

ex5-5a.inp

ex5-5b.inp

ex5-6.inp

ex5-6a.inp

ex5-6b.inp

ex5-7a.inp

ex5-7b.inp

ex5-8.inp

ex5-1.R

ex5-2a.R

ex5-2b.R

ex5-2c.R

ex5-3.R

ex5-3a.R

ex5-3b.R

ex5-4.R

ex5-4c.R

ex5-5b.R

ex5-6a.R

ex5-6b.R

ex5-7a.R

ex5-8.R

 

6 Latent state-trait models

health.dat

socex1.dat

ex6-1a.inp

ex6-1b.inp

ex6-1c.inp

ex6-1d.inp

ex6-1e.inp

ex6-2.inp

ex6-3a.inp

ex6-3b.inp

ex6-3c.inp

ex6-4a.inp

ex6-4b.inp

ex6-4c.inp

ex6-4d.inp

ex6-1a.R

ex6-1b.R

ex6-1c.R

ex6-1d.R

ex6-2.R

ex6-3b.R

ex6-3c.R

 

7 Linear latent growth curve models

health.dat

ex7-1a.inp

ex7-1b.inp

ex7-1c.inp

ex7-2a.inp

ex7-2b.inp

ex7-3a.inp

ex7-3b.inp

ex7-3c.inp

ex7-4a.inp

ex7-4b.inp

ex7-5a.inp

ex7-5b.inp

ex7-5c.inp

ex7-6a.inp

ex7-6b.inp

ex7-6c.inp

ex7-6d.inp

ex7-6e.inp

ex7-1a.R

ex7-1b.R

ex7-1c.R

ex7-2b.R

ex7-3b.R

ex7-3c.R

ex7-4b.R

ex7-5b.R

ex7-6a.R

ex7-6b.R

ex7-6c.R

ex7-6d.R

ex7-6e.R

 

8 Nonlinear latent growth curve models

health.dat

ex8-1a.inp

ex8-1b.inp

ex8-1c.inp

ex8-2a.inp

ex8-2b.inp

ex8-2c.inp

ex8-2d.inp

ex8-3a.inp

ex8-3b.inp

ex8-4.inp

ex8-5a.inp

ex8-5b.inp

ex8-5c.inp

ex8-1a.R

ex8-1b.R

ex8-1c.R

ex8-2a.R

ex8-2b.R

ex8-2c.R

ex8-2d.R

ex8-4.R

ex8-5a.R

ex8-5b.R

 

9 Latent difference score models

health.dat

ex9-1a.inp

ex9-2.inp

ex9-3.inp

ex9-4.inp

ex9-5a.inp

ex9-5b.inp

ex9-6.inp

ex9-1a.R

ex9-2.R

ex9-3.R

ex9-4.R

ex9-5a.R

ex9-6.R

 

10 Latent transition and growth mixture models

socex1.dat

health.dat

ex10-1a.inp

ex10-1b.inp

ex10-2a.inp

ex10-3a.inp

ex10-3b.inp

ex10-3c.inp

ex10-4a.inp

ex10-4b.inp

ex10-5.inp

 

11 Time series models

diabetes.dat

consumer.dat

diabetes2.dat

ex11-1a.inp

ex11-1b.inp

ex11-1c.inp

ex11-2.inp

ex11-3.inp

ex11-4.inp

ex11-5.inp

ex11-6.inp

ex11-7.inp

ex11-8.inp, ex11-8.out

ex11-9.inp

ex11-4.R

ex11-5.R

ex11-6.R

 

12 Survival analysis models

health survival.dat

socex2.dat

ex12-2a.inp

ex12-2b.inp

ex12-2c.inp

ex12-2d.inp

ex12-3a.inp

ex12-3b.inp

 

13 Missing data and attrition

health missing.dat

ex13-1a.inp

ex13-1b.inp

ex13-1c.inp

ex13-2a.inp

ex13-2b.inp

ex13-2c.inp

ex13-3a.inp

ex13-3b.inp

ex13-4a.inp

ex13-4b.inp

ex13-4c.inp

ex13-5.inp

ex13-6a.inp

ex13-6b.inp

ex13-1.R

ex13-2a.R

ex13-2b.R

ex13-2c.R

 

 

Data files contain the same data sets used in the text (many of the data sets are used in more than one chapter). Data were simulated to closely correspond with the mean, variances, and covariances of several real data sets. See Example Data Sets at the front of the book for additional information. Syntax files were developed using Mplus versions 7.1 - 7.3 and the lavaan R package versions 0.5-16 and 0.5-18.  All examples in the text are represented here. When variations on a particular model involve imposing constraints, only one example is given and notes on how to test the model variation are made in comments in the syntax.  Examples in lavaan code are provided where current features allow. Binary ML and latent class analysis examples are only available in Mplus, for example.  Thanks to Amanuel Zimam for help translating Mplus code to lavaan.