Message/Author 


I would like to generate monte carlo data sets using an external program and then model them in mplus. Is there a way to accomplish this? Thanks, Eric 


See Step 2 of Example 11.6. 


Thanks, that helps. I now have... TITLE: Montecarlo of snap; DATA: FILE = "z:\projects\snap archive\boot.txt"; TYPE = MONTECARLO; VARIABLE: NAMES = y1y285; categorical are y1y285; MISSING = .; ANALYSIS: TYPE = efa 1 2; OUTPUT: TECH9; The job runs through the (currently 3) datasets that I specify, but the output doesn't contain anything about the EFA, it ends after computing the correlation matrix. TECH9 lists each iteration, but no errors. I also note that each dataset runs fine on its own. Here is the tail end of the output: SAMPLE TETRACHORIC CORRELATIONS Y281 Y282 Y283 Y284 Y285 ________ ________ ________ ________ ________ Y282 0.012 Y283 0.032 0.012 Y284 0.002 0.013 0.007 Y285 0.024 0.049 0.023 0.003 Errors for replication with data file z:\projects\snap archive\boot1.dat: Errors for replication with data file z:\projects\snap archive\boot2.dat: Errors for replication with data file z:\projects\snap archive\boot3.dat: If that isn't enough to figure anything out, I can attach data. Thanks, Eric 


Please send your input, data, output, and license number to support@statmodel.com so I can see what is happening. 


Linda, by way of followup, I thought I might try the same problem using the Mplus monte carlo data generation rather than doing it internally. That would entail running a step one model to simply estimate all 285 thresholds, which could then be used as the basis for a monte carlo run using the population statement. I guess my question is, how can I run a model to do nothing but estimate and save the thresholds for a whole lot of categorical variables? 


I based this on the Monte Carlo counterpart Example 3.12: MODEL POPULATION: [u1$1*1 u1$2*1]; [u2$1*0]; [u3$1*.5 u3$2*.5 u3$3*1.5]; u1u3*1; 


Dr. Muthen I use MONTECARLO to generate 100 dataset. Then, I follow Example 11.6. I want to run a EFA model. I write: ANALYSIS: TYPE = EFA 1 2; Mplus doesn't show any results. Then I try to run a CFA model. I just write: model: f1 by y1y10; I get the results. Q: Does Mplus allow us to get EFA results based on 100 dataset ? Thanks. Mark 


EFA and Monte Carlo are not allowed because of problems with the order of the factors changing. 


Hi, I am referring to Example 12.6 in the Mpus User guide v7. Is it possible to specify starting values that are different from population values in the MODEL section? 


Yes. Population parameter values are specified in MODEL POPULATION. Coverage and starting values are specified in the MODEL command. 


Hi Dr Muthen, I using data generated externally similar to Example 12.6 Step 2. I tried specifying MODEL POPULATION command in the Example 12.6 step 2 input file, but Mplus does not recognise the command. 


You aren't generating data in step 2 so MODE POPULATION is not used. Specify starting and coverage value in the MODEL command. 


dear prof I want to generate Monte Carlo data sets using an external program and then model them in MPLUS. all of my repetition are in one datasheet,But I think MPLUS cannot understand them and I should shift every simulation to one datasheet? this is true? thanks 


Mplus requires the data set from each replication to be in a separate file. 


As far as I understand the answers I’ve seen on the discussion boards, it is possible to use the DEFINE command to create an interaction in the second step of an external Monte Carlo simulation. However, because the data are not defined with an interaction set as a population parameter (i.e. with the MODEL POPULATION command), then the interaction will not actually be present in the simulated data. Is that correct? Therefore, the only other method I have seen for ensuring the interaction is present as a population parameter, and that this population parameter shapes the data generation process, is to use the random slopes method described here: https://www.statmodel.com/download/ModeratedMediationSimulation.pdf If I understand the description on that linked pdf correctly, the model is ONLY mathematically equivalent to a standard linear regression with a product term if the residual for the equation of the slope of x’s effect on M is set to 0. Is that correct? Second, does anything in the syntax from that document, such as perhaps TYPE=RANDOM, need to be changed to make the analysis mathematically equivalent to a traditional moderation analysis using a product term? 


Q1Q2: Right Q3: No 

Back to top 