TITLE:
  Eq 5.3: Fixed Linear Time, Random Intercept Model

DATA:
  FILE = MPLUS_Chapter5.csv;
  FORMAT = FREE;

DEFINE:
  time = wave - 1;

VARIABLE:
  NAMES = PersonID wave outcome;
  USEVARIABLES = outcome time;
  MISSING = ALL (-9999);
  CLUSTER = PersonID;
  WITHIN = time;

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

MODEL:

%WITHIN%
  outcome;
  linear | outcome ON time;

%BETWEEN%
  [outcome linear] (int btime);
  outcome linear@0;

MODEL CONSTRAINT:
  NEW(est1-est4);
! est1: Intercept at Time=0
  est1 = int*1 + btime*0;
! est2: Intercept at Time=1
  est2 = int*1 + btime*1;
! est3: Intercept at Time=2
  est3 = int*1 + btime*2;
! est4: Intercept at Time=3
  est4 = int*1 + btime*3;