TITLE:this is an example of a Monte Carlo simulation study for a
two-level mixture regression for a continuous dependent variable
with a between-level categorical latent variable
montecarlo:
names are y x1 x2 w;
nobservations = 1000;
ncsizes = 3;
csizes = 40 (5) 50 (10) 20 (15);
genclasses = cb(2 b);
classes = cb(2);
between = cb w;
within = x1 x2;
seed = 3454367;
nrep = 1;
save = ex10.2.dat;
analysis:
type = twolevel mixture;
model population:
%within%
%overall%
x1-x2*1;
[x1-x2*0];
y on x1*2 x2*1;
y*1;
%cb#1%
y on x1*1 x2*2;
%between%
%overall%
[w@0]; w@1;
cb#1 on w*1;
y on w*.7; y*.5;
[cb#1*0];
[y*1];
%cb#1%
[y*2.4];
model:
%within%
%overall%
y on x1*2 x2*1;
y*1;
%cb#1%
y on x1*1 x2*2;
%between%
%overall%
cb#1 on w*1;
y on w*.7; y*.5;
[cb#1*0];
[y*1];
%cb#1%
[y*2.4];
output:
tech8 tech9;