TITLE: this is an example of a two-level
regression analysis for a continuous
dependent variable
montecarlo:
names are y x w xm;
nobservations = 1000;
ncsizes = 3;
csizes = 40 (5) 50 (10) 20 (15);
seed = 58459;
nreps = 1;
within = x;
between = w xm;
save = ex9.2a.dat;
ANALYSIS: TYPE = TWOLEVEL RANDOM;
model population:
%within%
[x@0]; x@1;
s | y on x;
y*1;
%between%
[w@0]; w*1;
[xm@0]; xm*.5;
w with xm*.5;
y on w*1 xm*1;
s on w*.5 xm*.3;
[y*2 s*1];
y*.5; s*.3;
y with s*.2;
model:
%within%
s | y on x;
y*1;
%between%
y on w*1 xm*1;
s on w*.5 xm*.3;
[y*2 s*1];
y*.5; s*.3;
y with s*.2;
output:
tech9;