title:
this is an example of mixture randomized
trials modeling using CACE estimation with
missing data on the latent class indicator
montecarlo:
names are u y x1 x2;
generate = u(1);
categorical = u;
! u is compliance status: 0/1 for noncomplying/complying
! u is a perfect indicator of c
missing = u;
cutpoints = x2(0);
! x2 is the 0/1 ctrl/tx dummy. Here split 50/50
genclasses = c(2);
classes = c(2);
nobs = 500;
seed = 3454367;
nrep = 1;
save = ex7.24.dat;
analysis:
type = mixture;
model population:
%overall%
x1-x2*1;
[x1-x2*0];
[c#1*0];
c#1 on x1*1;
y on x1*2 x2*.5;
[y*1]; y*1;
%c#1% !noncompliers
[u$1@15]; ! P(u = 1) = 0
y on x2@0;
[y*2];
y*2;
%c#2% !compliers
[u$1@-15]; ! P(u = 1) = 1
y on x2*.5;
[y*3];
y*1;
model missing:
%overall%
! the ctrl/tx dummy x2 determines u missingness
! note: model missing uses logistic regression
! parameterization with intercept and slope
[u@15]; ! prob missing = 1 for ctrls (x2=0)
u on x2@-30; ! prob missing = 0 for tx (x2=1)
model:
%overall%
[c#1*0];
c#1 on x1*1;
y on x1*2 x2*.5;
[y*1]; y*1;
%c#1% !noncompliers
[u$1@15]; ! P(u = 1 | c=1) = 0
y on x2@0;
[y*2];
y*2;
%c#2% !compliers
[u$1@-15]; ! P(u = 1 | c=2) = 1
y on x2*.5;
[y*3];
y*1;
output:
tech8 tech9;