TITLE:
Ch 4: Empty Means, First-Order Auto-Regressive Heterogeneous R-Only Model
DATA:
FILE = MPLUS_Chapter4.csv;
FORMAT = FREE;
DATA LONGTOWIDE:
LONG = posmood;
WIDE = posmood1-posmood7;
IDVARIABLE = PersonID;
REPETITION = studyday (1-7);
VARIABLE:
NAMES = PersonID studyday posmood;
USEVARIABLES = posmood1-posmood7;
MISSING = ALL (-9999);
ANALYSIS:
ESTIMATOR = ML;
PROCESSORS = 4;
OUTPUT:
STDYX;
MODEL:
posmood1-posmood7 (totvar1-totvar7);
posmood1-posmood6 PWITH posmood2-posmood7 (totcov1-totcov6);
posmood1-posmood5 PWITH posmood3-posmood7 (totcov7-totcov11);
posmood1-posmood4 PWITH posmood4-posmood7 (totcov12-totcov15);
posmood1-posmood3 PWITH posmood5-posmood7 (totcov16-totcov18);
posmood1-posmood2 PWITH posmood6-posmood7 (totcov19-totcov20);
posmood1 PWITH posmood7 (totcov21);
[posmood1-posmood7] (mean);
MODEL CONSTRAINT:
NEW(AR1cor);
totcov1 = AR1cor**1*SQRT(totvar1)*SQRT(totvar2);
totcov2 = AR1cor**1*SQRT(totvar2)*SQRT(totvar3);
totcov3 = AR1cor**1*SQRT(totvar3)*SQRT(totvar4);
totcov4 = AR1cor**1*SQRT(totvar4)*SQRT(totvar5);
totcov5 = AR1cor**1*SQRT(totvar5)*SQRT(totvar6);
totcov6 = AR1cor**1*SQRT(totvar6)*SQRT(totvar7);
totcov7 = AR1cor**2*SQRT(totvar1)*SQRT(totvar3);
totcov8 = AR1cor**2*SQRT(totvar2)*SQRT(totvar4);
totcov9 = AR1cor**2*SQRT(totvar3)*SQRT(totvar5);
totcov10 = AR1cor**2*SQRT(totvar4)*SQRT(totvar6);
totcov11 = AR1cor**2*SQRT(totvar5)*SQRT(totvar7);
totcov12 = AR1cor**3*SQRT(totvar1)*SQRT(totvar4);
totcov13 = AR1cor**3*SQRT(totvar2)*SQRT(totvar5);
totcov14 = AR1cor**3*SQRT(totvar3)*SQRT(totvar6);
totcov15 = AR1cor**3*SQRT(totvar4)*SQRT(totvar7);
totcov16 = AR1cor**4*SQRT(totvar1)*SQRT(totvar5);
totcov17 = AR1cor**4*SQRT(totvar2)*SQRT(totvar6);
totcov18 = AR1cor**4*SQRT(totvar3)*SQRT(totvar7);
totcov19 = AR1cor**5*SQRT(totvar1)*SQRT(totvar6);
totcov20 = AR1cor**5*SQRT(totvar2)*SQRT(totvar7);
totcov21 = AR1cor**6*SQRT(totvar1)*SQRT(totvar7);