TITLE: this is an example of a two-level CFA with
categorical individual-level factor indicators with two
factors on within and one factor on between and
continuous cluster-level indicators of a factor on between
montecarlo:
names are u1-u6 x1 x2 w y1-y4;
generate = u1-u6(1);
categorical = u1-u6;
nobservations = 1000;
ncsizes = 3;
csizes = 40 (5) 50 (10) 20 (15);
seed = 58459;
nreps = 1;
save = ex4.6.dat;
within = x1 x2;
between = w y1-y4;
ANALYSIS:
TYPE = TWOLEVEL;
estimator = wlsmv;
processors = 2;
MODEL POPULATION:
%WITHIN%
x1-x2@1;
fw1 by u1@1 u2-u3*1;
fw2 by u4@1 u5-u6*1;
fw1-fw2*1;
fw1 on x1*.5 x2*.7;
fw2 on x1*.7 x2*.5;
%BETWEEN%
[w@0]; w*1;
fb BY u1@1 u2-u6*1;
u1-u6*.3;
fb*.5;
fb on w*1 f*.5;
f by y1@1 y2-y4*1;
y1-y4*.5;
f*.5;
f on w*.25;
MODEL:
%WITHIN%
fw1 by u1@1 u2-u3*1;
fw2 by u4@1 u5-u6*1;
fw1-fw2*1;
fw1 on x1*.5 x2*.7;
fw2 on x1*.7 x2*.5;
%BETWEEN%
fb BY u1@1 u2-u6*1;
u1-u6*.3;
fb*.5;
fb on w*1 f*.5;
f by y1@1 y2-y4*1;
y1-y4*.5;
f*.5;
f on w*.25;
output:
tech9;