External Monte Carlo Sets PreviousNext
Mplus Discussion > Exploratory Factor Analysis >
Message/Author
 Eric Turkheimer posted on Monday, January 15, 2007 - 7:14 am
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
 Linda K. Muthen posted on Monday, January 15, 2007 - 7:57 am
See Step 2 of Example 11.6.
 Eric Turkheimer posted on Monday, January 15, 2007 - 11:35 am
Thanks, that helps. I now have...

TITLE: Montecarlo of snap;
DATA: FILE = "z:\projects\snap archive\boot.txt";
TYPE = MONTECARLO;
VARIABLE: NAMES = y1-y285;
categorical are y1-y285;
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
 Linda K. Muthen posted on Monday, January 15, 2007 - 11:58 am
Please send your input, data, output, and license number to support@statmodel.com so I can see what is happening.
 Eric Turkheimer posted on Wednesday, January 17, 2007 - 8:30 am
Linda, by way of follow-up, 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?
 Linda K. Muthen posted on Wednesday, January 17, 2007 - 9:05 am
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];
u1-u3*1;
 Hsien-Yuan Hsu posted on Tuesday, July 15, 2008 - 3:24 pm
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 y1-y10;

I get the results.

Q: Does Mplus allow us to get EFA results based on 100 dataset ?

Thanks.

Mark
 Linda K. Muthen posted on Tuesday, July 15, 2008 - 3:34 pm
EFA and Monte Carlo are not allowed because of problems with the order of the factors changing.
 Lim Jie Xin posted on Saturday, May 03, 2014 - 5:26 am
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?
 Linda K. Muthen posted on Saturday, May 03, 2014 - 11:34 am
Yes. Population parameter values are specified in MODEL POPULATION. Coverage and starting values are specified in the MODEL command.
 Lim Jie Xin posted on Saturday, May 03, 2014 - 9:19 pm
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.
 Linda K. Muthen posted on Sunday, May 04, 2014 - 6:22 am
You aren't generating data in step 2 so MODE POPULATION is not used. Specify starting and coverage value in the MODEL command.
 zahra sharafi posted on Tuesday, September 29, 2015 - 3:30 am
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
 Linda K. Muthen posted on Tuesday, September 29, 2015 - 9:59 am
Mplus requires the data set from each replication to be in a separate file.
 Neil Stenhouse posted on Monday, September 24, 2018 - 1:13 pm
As far as I understand the answers Ive 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 xs 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?
 Bengt O. Muthen posted on Monday, September 24, 2018 - 4:48 pm
Q1-Q2: Right

Q3: No
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: