TITLE:
  Eq 10a.1: Fixed Quadratic, Random Linear Model using Years in Study

DATA:
  ! Prior necessary data manipulation conducted using other programs
  FILE = MPLUS_Chapter10a.csv;
  FORMAT = FREE;

DEFINE:
  timesq = time*time;

VARIABLE:
  NAMES = PersonID occasion ageT0 tvage ytdT0 tvytd recall time
          roundage tvage84 ageT084 roundytd tvytd7 ytdT07;
  USEVARIABLES = recall time timesq;
  MISSING = ALL (-9999);
  CLUSTER = PersonID;
  WITHIN = time timesq;

ANALYSIS:
  ESTIMATOR = ML;
  PROCESSORS = 4;
  TYPE = TWOLEVEL RANDOM;

MODEL:

%WITHIN%
  recall;
  linear | recall ON time;
  quad | recall ON timesq;

%BETWEEN%
  [recall linear quad] (int btime btimesq);
  recall linear quad@0;
  recall WITH linear;