Message/Author |
|
|
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! |
|
|
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; |
|
|
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. many thanks in advance for your help |
|
|
All of the user's guide examples come with Monte Carlo counterparts. Example 5.16 is multiple group with binary items. You can extend the binary items to ordered categorical. See the GENERATE option of the MONTECARLO command. |
|
Back to top |