TITLE: this is an example of a Monte Carlo simulation study for a
two-level LTA with a covariate
and a between-level categorical latent variable
montecarlo:
names are u11-u14 u21-u24 x w;
generate = u11-u14 u21-u24(1);
categorical = u11-u14 u21-u24;
genclasses = cb(2 b) c1(2) c2(2);
classes = cb(2) c1(2) c2(2);
nobservations = 4000;
ncsizes = 1;
csizes = 200 (20);
within = x;
between = cb w;
seed = 3454367;
nrep = 1;
save = ex10.13.dat;
ANALYSIS: TYPE = twolevel MIXTURE;
MODEL population:
%within%
%OVERALL%
[x@0]; x@1;
c2#1 ON c1#1*0 x*1;
c1#1 on x*.5;
%between%
%overall%
w@1; [w@0];
c1#1 on cb#1*2;
c2#1 on cb#1*.5;
cb#1 on w*1;
Model population-cb:
%within%
%cb#1%
c2#1 on c1#1*1;
MODEL population-c1:
%between%
%c1#1%
[u11$1-u14$1*1] (1-4);
%c1#2%
[u11$1-u14$1*-1] (5-8);
MODEL population-c2:
%between%
%c2#1%
[u21$1-u24$1*1] (1-4);
%c2#2%
[u21$1-u24$1*-1] (5-8);
MODEL:
%within%
%OVERALL%
c2#1 ON c1#1*0 x*1;
c1#1 on x*.5;
%between%
%overall%
c1#1 on cb#1*2;
c2#1 on cb#1*.5;
cb#1 on w*1;
Model cb:
%within%
%cb#1%
c2#1 on c1#1*1;
MODEL c1:
%between%
%c1#1%
[u11$1-u14$1*1] (1-4);
%c1#2%
[u11$1-u14$1*-1] (5-8);
MODEL c2:
%between%
%c2#1%
[u21$1-u24$1*1] (1-4);
%c2#2%
[u21$1-u24$1*-1] (5-8);
OUTPUT: TECH8 tech9;