Skip to content

Commit c72f8de

Browse files
20260202 - LCM-SR in multilevel SEM
1 parent 857db5e commit c72f8de

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed

hlm.qmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,10 @@ nonlinearModel <- nlme(
809809
summary(nonlinearModel)
810810
```
811811

812+
# Cross-Lagged Models
813+
814+
Multilevel cross-lagged models can be estimated using [multilevel structural equation modeling](#mplus.qmd#sec-msem-lcm-sr).
815+
812816
# Robust Mixed Models
813817

814818
To evaluate the extent to which a finding could driven by outliers, this could be done in a number of different ways, such as:

lda.qmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ title: "Longitudinal Data Analysis"
99
- [Latent change score model](sem.qmd#sec-lcsm)
1010
- [Cross-lagged panel model](sem.qmd#sec-clpm)
1111
- [Latent curve model with structured residuals](sem.qmd#sec-lcm-sr)
12+
- [Latent curve model with structured residuals with long data in multilevel SEM](mplus.qmd#sec-msem-lcm-sr)
1213

1314
# Longitudinal Scores are on the Same Statistical Scale Across Time
1415

mplus.qmd

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,71 @@ OUTPUT:
824824
TECH9;
825825
```
826826

827+
# Multilevel Structural Equation Modeling (M-SEM) {#sec-msem}
828+
829+
## Latent Curve Model with Structured Residuals (LCM-SR) {#sec-msem-lcm-sr}
830+
831+
A latent curve model with structured residuals (LCM-SR) estimated with long-form data in multilevel SEM allows estimating a cross-lagged model to (a) determine the direction of effect between two constructs, (b) account for individual differences in level and change of each construct, (c) account for unbalanced time, and (d) disaggregate within-person from between-person effects.
832+
833+
This example is adapted from Hoffman's [Example 5A](https://www.lesahoffman.com/PSQF7375_AdvLong/index.html):
834+
835+
```
836+
TITLE: Latent Curve Model with Structured Residuals with Long-Form
837+
Data in Multilevel SEM
838+
839+
DATA:
840+
FILE = "C:/[insert_filepath]/filename.dat";
841+
842+
VARIABLE: ! List of variables in data file
843+
NAMES = PersonID sex A B time timesq;
844+
! Variables to be analyzed in this model
845+
USEVARIABLE = time timesq sex A B;
846+
MISSING ARE ALL (-999); ! Missing data identifier
847+
! MLM options
848+
CLUSTER = PersonID; ! Level-2 ID
849+
BETWEEN = sex; ! Observed ONLY level-2 predictors
850+
WITHIN = time timesq; ! Observed ONLY level-1 predictors
851+
LAGGED = A(1) B(1); ! Create Mplus lag-1 variables
852+
853+
ANALYSIS:
854+
TYPE = TWOLEVEL RANDOM;
855+
ESTIMATOR = BAYES;
856+
BITERATIONS = 50000;
857+
858+
OUTPUT:
859+
TECH8; ! Used to examine convergence
860+
861+
MODEL: ! A = construct 1; B = construct 2
862+
%WITHIN%
863+
A B (Aresvar Bresvar); ! L1 residual variances (labels)
864+
Alin | A ON time; ! Placeholder for A linear change
865+
Aquad | A ON timesq; ! Placeholder for A quadratic change
866+
Blin | B ON time; ! Placeholder for B linear change
867+
A WITH B (ResCov); ! L1 WP covariance for concurrent B->A
868+
A^ ON B^1 (BALagEff); ! L1 WP fixed effect of ^residual lagged B->A
869+
B^ ON A^1 (ABLagEff); ! L1 WP fixed effect of ^residual lagged A->B
870+
871+
%BETWEEN%
872+
[A B Alin Aquad Blin]; ! Fixed intercepts, fixed change slopes
873+
A B (Aintvar Bintvar); ! L2 G: Random intercept variances (labels)
874+
Alin Blin (Alinvar Blinvar); ! L2 G: Random linear change variances
875+
A Alin ON sex (XtoYint XtoYlin); ! sex -> A int, A linear change
876+
B Blin ON sex (XtoYint XtoYlin); ! sex -> B int, B linear change
877+
A Alin B Blin WITH A Alin B Blin; ! L2 G: covariances for random intercepts and change across outcomes
878+
Rquad@0; ! No quadratic change variance
879+
880+
MODEL CONSTRAINT:
881+
NEW(A2Bsd B2Asd);
882+
! STD = Unstd * SQRT(Xvar) / SQRT(Yvar)
883+
A2Bsd = ABLagEff * SQRT(8.3538) / SQRT(0.08077); ! STD A->B lagged effect
884+
B2Asd = BALagEff * SQRT(0.08077) / SQRT(8.3538); ! STD B->A lagged effect
885+
```
886+
887+
Further extensions:
888+
889+
- Distinguish between (a) time in study versus (b) age at baseline (as a moderator)
890+
- Allow the cross-lagged effects to vary as a function of time (add time as a moderator of those effects)
891+
827892
# Session Info
828893

829894
```{r}

sem.qmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,6 +1832,7 @@ lavaangui::plot_lavaan(riclpm1_fit)
18321832
# Latent Curve Model with Structured Residuals {#sec-lcm-sr}
18331833

18341834
A latent curve model with structured residuals (LCM-SR) is also called an autoregressive latent trajectory model with structured residuals (ALT-SR).
1835+
A LSM-SR model can also be estimated using [multilevel SEM](#mplus.qmd#sec-msem-lcm-sr).
18351836

18361837
## Model Syntax
18371838

0 commit comments

Comments
 (0)