TITLE:
  Ch 9: Fixed Linear Age, Random Intercept Model for Monitoring

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

VARIABLE:
  NAMES = PersonID att12 PMmon copymon18 occasion age risky monitor agec18 att4
          mon3 PMmon3 WPmon A18mon3 Ch18mon;
  USEVARIABLES = monitor agec18;
  MISSING = ALL (-9999);
  CLUSTER = PersonID;
  WITHIN = agec18;

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

MODEL:

%WITHIN%
  monitor;
  linear | monitor ON agec18;

%BETWEEN%
  [monitor linear] (int bagec18);
  monitor linear@0;