title:
Introducing Multilevel Modeling by Kreft and de Leeuw.
Page 83, Table 4.13
data:
file = imm23.dat ;
variable:
names = schid stuid ses meanses homework white parented public
ratio percmin math sex race sctype cstr scsize urban region;
cluster = schid;
usevar = math homework white public;
within = homework white; ! level 1 variables here
between = public; ! level 2 variables here
analysis:
type = twolevel random;
estimator = ml;
model:
%within%
math; ! no fixed effects
b1 | math on homework; ! random effect homework predicting math
b2 | math on white; ! random effect white predicting math
%between%
math on public; ! public predicts intercept
b1; ! nothing predicts b1 (homework slope)
b2; ! nothing predicts b2 (white slope)
math with b1; ! covariance intercept and b1
math with b2; ! covariance intercept and b2
b1 with b2; ! covariance b1 and b2