TITLE:
Eq 9.3: Multivariate Longitudinal Model using MLM Syntax
Across-Variable Relationships via Covariances
DATA:
FILE = MPLUS_Chapter9.csv;
FORMAT = FREE;
DEFINE:
agesq = agec18*agec18;
VARIABLE:
NAMES = PersonID att12 PMmon copymon18 occasion age risky monitor agec18 att4
mon3 PMmon3 WPmon A18mon3 Ch18mon;
USEVARIABLES = risky mon3 att4 agec18 agesq;
MISSING = ALL (-9999);
CLUSTER = PersonID;
WITHIN = agec18 agesq;
BETWEEN = att4;
ANALYSIS:
ESTIMATOR = ML;
PROCESSORS = 4;
TYPE = TWOLEVEL RANDOM;
MODEL:
%WITHIN%
risky mon3 (Rresvar Mresvar);
risky WITH mon3 (RresMres);
Rlin | risky ON agec18;
Mlin | mon3 ON agec18;
Rquad | risky ON agesq;
%BETWEEN%
[risky mon3 Rlin Mlin Rquad] (bRint bMint bRlin bMlin bRquad);
risky mon3 Rlin Mlin Rquad@0 (Rintvar Mintvar Rlinvar Mlinvar Rquadvar);
risky WITH Rlin (RintRlin);
mon3 WITH Mlin (MintMlin);
risky WITH mon3 (RintMint);
Rlin WITH Mlin (RlinMlin);
risky WITH Mlin (RintMlin);
Rlin WITH mon3 (RlinMint);
risky Rlin ON att4 (battRint battRlin);
MODEL CONSTRAINT:
NEW(WPresc BPintc BPlinc BPRIRLc BPMIMLc BPRIMLc BPRLMIc);
WPresc = RresMres / (SQRT(Rresvar)*SQRT(Mresvar));
BPintc = RintMint / (SQRT(Rintvar)*SQRT(Mintvar));
BPlinc = RlinMlin / (SQRT(Rlinvar)*SQRT(Mlinvar));
BPRIRLc = RintRlin / (SQRT(Rintvar)*SQRT(Rlinvar));
BPMIMLc = MintMlin / (SQRT(Mintvar)*SQRT(Mlinvar));
BPRIMLc = RintMlin / (SQRT(Rintvar)*SQRT(Mlinvar));
BPRLMIc = RlinMint / (SQRT(Rlinvar)*SQRT(Mintvar));