TITLE:
Ch 4: Empty Means, Random Intercept in G
1-Lag Toeplitz R
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:
RandInt BY posmood1-posmood7@1;
RandInt (intvar);
posmood1-posmood7 (resvar);
posmood1-posmood6 PWITH posmood2-posmood7 (rescov1-rescov6);
%%STR([posmood1-posmood7@0 RandInt]);
MODEL CONSTRAINT:
NEW(TOEPcor1);
rescov1 = TOEPcor1*SQRT(resvar)*SQRT(resvar);
rescov2 = TOEPcor1*SQRT(resvar)*SQRT(resvar);
rescov3 = TOEPcor1*SQRT(resvar)*SQRT(resvar);
rescov4 = TOEPcor1*SQRT(resvar)*SQRT(resvar);
rescov5 = TOEPcor1*SQRT(resvar)*SQRT(resvar);
rescov6 = TOEPcor1*SQRT(resvar)*SQRT(resvar);