Message/Author 


Hi, I want to use the monte carlo facility to generate data for two independent groups, and then fit a CFA model in each group. Here is some syntax that I wrote, which runs but does not properly set up the populations (i.e., the fixed parameter values are not as I specified). Can you tell me if I am on the right track with my syntax? TITLE: simulations for twogrp p=2 model MONTECARLO: NAMES ARE z1 y1; NGROUPS = 2; NOBSERVATIONS = 200 200; NREPS = 5; SEED = 897; MODEL POPULATION: f1 BY z1@1.0 y1@.6; [f1@0]; [z1@.5 y1@.3]; f1@.5; z1@.21; y1@.18; MODEL f1 BY z1@1.0 y1*; z1(1); y1(2); f1(3); MODEL POPULATION: f1 BY z1@1.0 y1@.6; [f1@.3]; [z1@.5 y1@.3]; f1@.5; z1@.21; y1@.18; MODEL G2: [f1*]; OUTPUT: TECH9; 


See mcex5.14.inp. You need a groupspecific MODEL POPULATION command. You also need a colon after the first MODEL command. If you continue to have problems with this, send your output and license number to support@statmodel.com. 


Thanks. Where is the mcex5.14.inp example to be found? 


It is put on the hard disk when the program is installed. Check Program Files/Mplus and you should see the examples. Each example in the user's guide has a Monte Carlo counterpart that was used to generate the data for the examples. All examples and Monte Carlo counterparts come on the Mplus CD. They are also available on the website. 

Jisoo Ock posted on Monday, September 03, 2012  10:14 pm



Hello, I wanted to use the Monte Carlo function to generate data for two independent groups, and then conduct measurement invariance analysis on each of the generated data (e.g., a metric invariance analysis with indicator x1 serving as the referent indicator and rest of the indicator loadings constrained to be equal). Is it possible to write a MODEL command so that the program generates the data and does the invariance analysis? Here is my syntax: TITLE: Sample simulation MONTECARLO: NAMES ARE x1x4; NOBSERVATIONS = 500 500; NREPS = 500; NGROUPS = 2; MODEL POPULATION: [x1@.225]; [x2@.025]; [x3@.010]; [x4@.240]; x1x4@.96; f1@1; f1 BY x1*.3 x2*.5 x3*.9 x4*.7; MODEL POPULATIONg2: [x1@.100]; [x2@.225]; [x3@.240]; [x4@.025]; x1x4@.96; f1@1; f1 BY x1*.3 x2*.5 x3*.7 x4*.5; Thank you. 


If you mean "can Mplus automatically do the chisquare testing of the invariance model against the noninvariance model" in a Monte Carlo run, the answer is no. People have done that via external Monte Carlo and matching up the replications by other programs, such as the R program MplusAutomation. 

Tom Booth posted on Saturday, March 02, 2013  1:58 pm



Hi Linda/Bengt, A quick question.Is it possible to request (either as output to be extracted or simply viewed) the population covariance matrices from which the data is generated in the Monte Carlo procedure when the population model is multigroup? Thanks. Tom 


If the RESIDUAL option is available for your analysis, this should give you what you want. 

Back to top 