TITLE:
  Ch 10a: Fixed Quadratic, Random Intercept Model using Years since Birth

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

DEFINE:
  tvagesq = tvage84*tvage84;

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

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

MODEL:

%WITHIN%
  recall;
  linear | recall ON tvage84;
  quad | recall ON tvagesq;

%BETWEEN%
  [recall linear quad] (int btvage84 btvagesq);
  recall linear@0 quad@0;