Skip to content

Commit c695314

Browse files
20250515 - latent class growth analysis
1 parent c9dfa5c commit c695314

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

mplus.Rmd

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,48 @@ DATA: FILE = "implist.dat"; ! where implist.dat is the name of the *list.dat fil
574574
TYPE = IMPUTATION;
575575
```
576576

577+
# Latent Class Growth Analysis {#lcga}
578+
579+
```
580+
VARIABLE:
581+
NAMES = id y1 y2 y3 y4;
582+
USEVARIABLES = y1 y2 y3 y4;
583+
IDVARIABLE = id;
584+
CLASSES = c(3); ! 3 latent classes
585+
MISSING = .;
586+
587+
ANALYSIS:
588+
TYPE = MIXTURE;
589+
ESTIMATOR = MLR;
590+
STARTS = 500 20;
591+
STITERATIONS = 20;
592+
593+
MODEL:
594+
%OVERALL%
595+
i s q | y1@0 y2@1 y3@2 y4@3; ! intercept, linear slope, quadratic slope
596+
i@0; s@0; q@0; ! fix variances to zero (LCGA assumption)
597+
598+
%c#1%
599+
[i s q]; ! freely estimate class-specific means
600+
601+
%c#2%
602+
[i s q];
603+
604+
%c#3%
605+
[i s q];
606+
607+
OUTPUT:
608+
standardized TECH1 TECH4 TECH8 TECH11 TECH14;
609+
610+
PLOT:
611+
TYPE = PLOT3;
612+
SERIES = y1(0) y2(1) y3(2) y4(3);
613+
614+
SAVEDATA:
615+
FILE = lcga_3class_prob.dat;
616+
SAVE = CPROBABILITIES;
617+
```
618+
577619
# Run Models in Batch {#runModels}
578620

579621
Run models in batch via `R`:

0 commit comments

Comments
 (0)