Mixed Model in SAS:
PROC SORT DATA = ortho;
BY subject age;
PROC MIXED;
CLASS subject age;
MODEL distance = age sex sex*age;
RANDOM INTERCEPT age / TYPE = FA0(2) SUB = subject;
REPEATED / TYPE = AR(1) SUB = subject;
• SORT: the data set must be sorted on the SUBJECT variable – otherwise PROC
MIXED will silently report nonsense. Many longitudinal analyses also require
sorting on the time variable.
• MODEL statement:
o specifies the fixed model
o includes the INTERCEPT by default
o contains time-varying, time-invariant and cross-level variables together
|