TITLE: this is an example of a two-level CFA
with continuous factor indicators, a random
intercept factor, and covariates
montecarlo:
names are y1-y4 x1 x2 w;
nobservations = 1000;
ncsizes = 3;
csizes = 40 (5) 50 (10) 20 (15);
seed = 58459;
nreps = 1;
save = ex9.6.dat;
within = x1 x2;
between = w;
ANALYSIS:
TYPE IS TWOLEVEL;
MODEL POPULATION:
%Within%
x1-x2@1;
fw BY y1@1
y2*1
y3*1
y4*1;
fw ON x1*1 x2*.5;
y1-y4*1;
fw*1;
%Between%
[w@0]; w@.7;
fb BY y1@1
y2*1
y3*1
y4*1;
fb ON w*.5;
fb*.4;
y1-y4@0;
MODEL:
%Within%
fw BY y1@1
y2*1
y3*1
y4*1;
fw ON x1*1 x2*.5;
y1-y4*1;
fw*1;
%Between%
fb BY y1@1
y2*1
y3*1
y4*1;
fb ON w*.5;
fb*.4;
y1-y4@0;
output:
tech8 tech9;