TITLE:
Ch 7b: Random Quadratic Age Model
DATA:
FILE = MPLUS_Chapter7b.csv;
FORMAT = FREE;
DEFINE:
agesq = agec18*agec18;
VARIABLE:
NAMES = PersonID att12 copymon18 occasion age risky monitor agec18 att4;
USEVARIABLES = risky agec18 agesq;
MISSING = ALL (-9999);
CLUSTER = PersonID;
WITHIN = agec18 agesq;
ANALYSIS:
ESTIMATOR = ML;
PROCESSORS = 4;
TYPE = TWOLEVEL RANDOM;
MODEL:
%WITHIN%
risky;
linear | risky ON agec18;
quad | risky ON agesq;
%BETWEEN%
[risky linear quad] (int bagec18 bagesq);
risky linear quad;
risky linear quad WITH risky linear quad;
MODEL CONSTRAINT:
NEW(est1-est14);
est1 = int*1 - bagec18*6 + bagesq*36;
est2 = int*1 - bagec18*5 + bagesq*25;
est3 = int*1 - bagec18*4 + bagesq*16;
est4 = int*1 - bagec18*3 + bagesq*9;
est5 = int*1 - bagec18*2 + bagesq*4;
est6 = int*1 - bagec18*1 + bagesq*1;
est7 = int*1 - bagec18*0 + bagesq*0;
est8 = bagec18*1 - bagesq*12;
est9 = bagec18*1 - bagesq*10;
est10 = bagec18*1 - bagesq*8;
est11 = bagec18*1 - bagesq*6;
est12 = bagec18*1 - bagesq*4;
est13 = bagec18*1 - bagesq*2;
est14 = bagec18*1 - bagesq*0;