Multigroup Monte Carlo
Message/Author
 Thomas Carpenter posted on Tuesday, August 12, 2014 - 1:30 pm
I have a quick question and was having difficulty adapting the manual examples for these purposes. I was wanting to create a monte carlo situation where Y is regressed on X in 3 separate groups. I would like to set the slopes different in each group (e.g., .60 for group 1, .30 in group 2, 0.0 in group 3).

I had run a model before similar to this and used the following code, defining a categorical variable with levels "high" "med" and "low":

Model:
y on x;

Model high:
y on x (a1);

Model med:
y on x (a2);

Model low:
y on x (a3);

How would I run a monte carlo simulation of something like that? Is there any code I could reference / adapt?

Thanks in advance for the help!
 Bengt O. Muthen posted on Tuesday, August 12, 2014 - 3:31 pm
Look at UG ex 12.12. It is like this:

title: this is an example of a multiple group CFA
with covariates (MIMIC) with continuous
factor indicators

montecarlo:
names = y1-y6 x1-x3;
ngroups = 2;
nobs = 500 600;
nreps = 1;
save = ex5.14.dat;

model population:

[x1@0 x2@1 x3@2]; x1@3 x2@2 x3@1;

f1 by y1@1 y2-y3*1;
f2 by y4@1 y5-y6*1;
f1 on x1*.5 x2*.6 x3*.7;
f2 on x1*.7 x2*.6 x3*.5;

f1-f2*.7;
f1 with f2*.25;

y1-y6*.5;

model population-g2:

f1 by y3*.5;

model:

f1 by y1@1 y2-y3*1;
f2 by y4@1 y5-y6*1;
f1 on x1*.5 x2*.6 x3*.7;
f2 on x1*.7 x2*.6 x3*.5;

f1-f2*.7;
f1 with f2*.25;

y1-y6*.5;

model g2:

f1 by y3*.5;

output:
tech9;
 thanoon younis posted on Tuesday, September 09, 2014 - 5:35 am
Hi Prof. Muthen
i want to change the values of observed variables in the previous example of simulation data to ordered categorical and dichotomous.
i hope to give me also an example of simulation data in multiple group SEMs with ordered categorical and dichotomous.