Monte Carlo Models PreviousNext
Mplus Discussion > Confirmatory Factor Analysis >
Message/Author
 Jeremy Miles posted on Tuesday, December 07, 2004 - 3:47 am
Hello,

I was trying out the Monte Carlo modelling, in Mplus, using the first example from Muthen and Muthen - How To Use A Monte Carlo Study To Decide On Sample Size and Determine Power.

I get two error messages:

First:
Your Text*** ERROR in Montecarlo command
Unknown option:
GCLASSES


I stopped that error by changing gclasses to genclasses, but I'm not positive that's correct.

But then I get:

*** ERROR in Montecarlo command
Unknown option:
NCLASSES
.

And I wasn't sure how to correct that one.

I'm using Mplus v3.11.

Thanks,

Jeremy

P.S. I've left the manual at home, and was trying to respond to this message, on a mailing list with a Monte Carlo simulation. Although if anyone thinks I'm wrong (or right) they could post to the list. (I think you have to join it, at www.jiscmail.ac.uk, but it's not got a lot of traffic.
 Linda K. Muthen posted on Tuesday, December 07, 2004 - 6:41 am
GCLASSES has been changed to GENCLASSES. And NCLASSES has been changed to CLASSES in Version 3. If you are away from your user's guide in the future, the last chapter which summarizes all of the Mplus language can be found at www.statmodel.com under the Demo.
 Linda K. Muthen posted on Tuesday, December 07, 2004 - 8:25 am
One more thing. The Mplus Version 3 CD comes with all of the examples from the Mplus User's Guide plus Monte Carlo counterparts of most of these examples. These are a good place to start if you want to do a Monte Carlo study.
 Paul Tremblay posted on Thursday, November 10, 2005 - 2:13 pm
When conducting a monte carlo run such as the example 11.5 in the manual is there any way to obtain the population covariance matrix.
 BMuthen posted on Saturday, November 12, 2005 - 5:43 pm
This is not part of the output in a Monte Carlo analysis. You would use the MODEL POPULATION model from your Monte Carlo analysis in the MODEL command of a regular analysis with all parameters fixed to the population values. Use as data in this regular analysis a matrix of means zero, variances one, and covariances zero. Ask for RESIDUAL in the OUTPUT command. The estimated matrix you obtain is the population covariance matrix.
 CG posted on Thursday, January 18, 2007 - 9:32 am
I am interested in running a CFA model simulation in MPLUS. I have two questions:
1) I have external datafiles (like example 11.6) that I wish to read. While I've saved the data files as separate files, I can't get MPLUS to read in the successive datasets.
Here is an example, where the files are named MPLUS.rep1.dat, MPLUS.rep2.dat (following example 11.6)
TITLE: try1
data: FILE IS MPLUS.replist.DAT;
TYPE IS MONTECARLO;
VARIABLE: NAMES ARE Y1-Y10;
MODEL: F1 BY Y1-Y5;
F2 BY Y6-Y10;

2) If the save data command is used, are the parameters that are saved standardized or unstandardized? If unstandardized, how can they be converted to standardized parameters?

thank you
 Linda K. Muthen posted on Thursday, January 18, 2007 - 9:49 am
Please send your output and license number to support@statmodel.com so I can see what error message you are getting.

The unstandardized coefficients are saved. You would have to standardize them if you want the standardized parameters.
 CG posted on Thursday, January 18, 2007 - 10:42 am
Thank you, I will send my output.

Regarding computing standardized parameters, can this be done using the MPLUS output information saved in the SAVEDATA file? If so, how?
 Linda K. Muthen posted on Friday, January 19, 2007 - 10:22 am
If you want to standardize the saved raw parameter estimates, you need to find the appropriate variances, turn them into standard deviations, and apply the proper formulas to each estimate.
 Gareth posted on Thursday, February 07, 2008 - 3:50 am
In the example for a growth model (normal, no missing data, with covariate) monte carlo study to determine sample size, could you tell me how
[x@0]; x@1;
corresponds to a mean of 0.5 and a variance of 0.25 for the dichotomous covariate?

If square brackets indicate means and x@1 indicates variance I'm not sure what I'm missing.

Thank you in advance
 Linda K. Muthen posted on Thursday, February 07, 2008 - 8:30 am
I think you will find that the CUTPOINTS option is used to make x a binary variable.
 Janke C. ten Holt posted on Wednesday, July 29, 2009 - 7:54 am
I would like to compare factor score estimates for different models (i.e., IRT, ordinary FA with ML estimation, and FA with WLSMV for categorical data) by running a Monte Carlo simulation.
For this, I need factor scores to be generated for every run of each model.
Is it true that this cannot be done in Mplus (since the savedata=fscores option is not available for type=montecarlo)?
And if so, could you suggest an alternative way of obtaining factor scores for each replication?

Thank you in advance
 Linda K. Muthen posted on Wednesday, July 29, 2009 - 1:44 pm
You would need to run the analysis for each data set separately if you want factor scores.
 Carol Parker posted on Wednesday, May 19, 2010 - 8:50 am
Hello,

I am attempting to conduct a Monte Carlo study (using the external Monte Carlo procedure) in which I simulate data for two groups, each of which has a different underlying factor model (e.g., there are group-based differences in factor loadings). Subsequent to this I hope to analyze the data ignoring group membership. In step 1 of the procedure, the population values (e.g., of the factor loadings) in the output are consistent with what I've specified in my population model. However, the average estimates seem to be higher than what I would have anticipated, and I am concerned that this suggests I've made an error. On the other hand, this may be due to the fact that I have fixed an invariant factor loading to 1 in each of the groups in the subsequent model statement (i.e,. the model statement that follows the population model statement.) Should the average estimates in each group approximate the values specified in the population model, or is it likely that the discrepancies I'm concerned about are due to my identification constraint in the subsequent model statement? Thank you very much for your assistance with this!
 Linda K. Muthen posted on Thursday, May 20, 2010 - 11:34 am
Try using 10 replications and 10,000 observations. If the average values do not match the population values, then you are most likely doing something wrong. If you are fixing the first factor loading to one now but generated the data with all factor loadings free and the factor variance fixed to one, this may be an issue.
 Carol Parker posted on Thursday, May 20, 2010 - 2:16 pm
Thank you for your response. I tried what you suggested and had similar results. To clarify, my goal is to generate data for two groups, each with specified population values for factor loadings, residual variances, and factor means and variances. Subsequent to this I will analyze the data generated in step 1 (using type = montecarlo and the list.dat file created in the first step.) Since posting my question I found the following response to a question on another thread:

"Example 11.6 shows how to save data for a subsequent external Monte Carlo. You don't need the MODEL command if you are only saving the data. You do need the ANALYSIS command. Nothing in the MODEL command affects data generation."

If my goal is to generate data in the first step that will be saved and used in subsequent analyses, it sounds from this like I may not need to be concerned with the model statement in the first step that seems to be giving rise to the odd average parameter estimates? The average parameter values for the residual variances are consistent with the population values. The factor loadings are not, and the values of the factor loadings change depending upon which item I fix to 1. Furthermore, if I omit the model statement, my output does not include information on the population values of the parameters I specified in the population model statement -- I only get information on the item variances.
 Linda K. Muthen posted on Thursday, May 20, 2010 - 6:44 pm
Why do you need to use external Monte Carlo? This is usually done when internal Monte Carlo cannot be done.

You don't need the MODEL command when only generating data because the data are generated according to the model specified in the MODEL POPULATION command not the MODEL command.
 Daniel Gucciardi posted on Wednesday, October 12, 2011 - 5:53 pm
Dear Mplus Team and Forum Members,

Iím new to Monte Carlo simulations so any advice you could offer is greatly appreciated. Iíve performed a CFA of a 48-item questionnaire (correlated four-factor model) with 345 participants (CFI = .48, TLI = .45, SRMR = .09, RMSEA = .090, 90% CI = .087 to .093). Iíve subsequently revealed similar findings of inadequate model fit using ESEM.

Another reviewer has requested that I provide some justification for adequacy of the sample, referring me to the following paper:

Myers, Ahn, and Ying (2011)

Iíve also read Muthťn and Muthťnís (2002) paper. Iím interested in estimating the amount of power I will have with my fixed sample size of 345 participants. Thus, I was hoping you might be able to shed light on the following questions:

1. As there are no previous factor analytical studies of this measure, despite being employed in over 15 published studies now, is it justifiable for me to use the parameters from my CFA analysis as input for the population parameter estimates? My concern in this regard relates to the large degree of model misfit.

2. If using the parameters from my CFA model is not recommended, how else could I go about creating values for the population estimates with no other empirical data? Or is there some other method(s) that I could explore for estimating power post hoc?

Many thanks in advance.

Cheers,
Daniel
 Linda K. Muthen posted on Thursday, October 13, 2011 - 9:22 am
If the model fits poorly, this will not work.

I question whether your data support four factors if the ESEM does not fit. You should do an EFA with these data to see how many factors are actually represented. If you are not using MLR, I would suggest that.
 Stephen Cox posted on Sunday, February 03, 2013 - 3:24 pm
Hi there - I am trying to install the runall utility so as to read in externally generated files for analysis. I have a 64-bit windows system, with which the runall utility appears incompatible.

Is this correct? Is there a version for the 64-bit version of Mplus?
 Linda K. Muthen posted on Sunday, February 03, 2013 - 3:48 pm
You should instead use external Monte Carlo. See Step 2 of Example 12.6. This has replaced RUNALL.
 Stephen Cox posted on Wednesday, February 06, 2013 - 4:50 pm
Thanks - I have made good progress.

I am having trouble getting my population defined correctly. Below is a simplified 2 factor CFA model I am testing using external monte carlo.

My problem is with defining the population covariance of the two latents (called global and study). The model runs if I do not include a population value, or leave the covariance statement out, but then sets the population value at 0 (thus the model does not fit).

If I include a population value, as shown below, the model does not converge (it says I have no free paramters).

What am I doing wrong?

Data:
file = resamplereplist.dat;
type = montecarlo;

Variable:
Names = blah blah;
usevariables = blah blah;

Model:

global by ycopia8@1;
global by ycopia9*1.22 (p2);
global by ycopia10*1.054 (p3);
global by ycopia11*-.546 (p4);
study by ycopia15@1 (p5);
study by ycopia16*1.261 (p6);
study by ycopia17*1.216 (p7);
study by ycopia18*.654 (p8);
study with global*.514;


SAVEDATA:
results = resamplea.dat;
 Linda K. Muthen posted on Thursday, February 07, 2013 - 9:47 am
Please send the output and your license number to support@statmodel.com.
 Christopher Niileksela posted on Saturday, March 08, 2014 - 6:59 am
Hello - I am trying to run a monte carlo for a higher-order factor model. I am mostly interested in power for the factor loadings. I'm using standardized factor loadings from previous research for the model and had a question about how to set the residuals for the first-order factors. Right now, my model is:


F1 BY x1*.90 x2*.84 x3*.84;
F2 BY x4*.77 x5*.81 x6*.68;
F3 BY x7*.62 x8*.66;
F4 BY x9*.81 x10*.74;
higherOr BY F1*.85 F2*.63 F3*.86 F4*.84;

F1@.2775;
F2@.6031;
F3@.2604;
F4@.2944;
higherOr@1;

x1*.19; x2*.29; x3*.29;
x4*.41; x5*.34; x6*.54;
x7*.62; x8*.56;
x9*.34; x10*.45;

I am setting starting values for the indicator residuals by subtracting the squared 1st order factor loading from 1. My question is: Should the first-order factor variances be fixed using the same method, by subtracting the the squared second-order factor loading from 1 (as I have in the example above)? Or would the first order residual variances be set to 1? Something has to be fixed for the model to be identified, and I've searched to find out what the appropriate method would be for this. Any help would be greatly appreciated!
 Bengt O. Muthen posted on Monday, March 10, 2014 - 5:21 pm
I would assume that your original analysis has f1-f4 variances of 1 (it looks like it), which means that subtracting squared 1st-order loadings from 1 gives you the res-vars of the factor indicators. You can fix the 1st-order resvars to the values you show - those values don't need to be 1.
 Christopher Niileksela posted on Monday, March 10, 2014 - 5:57 pm
Thank you for the clarification!
 Joshua Wilson posted on Sunday, March 23, 2014 - 8:49 pm
Hello,

I am trying to estimate Power based on a CFA model I estimated that had 10 continuous indicator variables, 3 latent factors, and a sample size of 179.

Is it acceptable to use the parameter estimates of the CFA model (generated from the SVALUES command) in BOTH of the following sections of the syntax for the montecarlo analysis?

MODEL POPULATION:
MODEL:

Thanks
 Linda K. Muthen posted on Monday, March 24, 2014 - 6:04 am
If that is your best estimate of your population parameter values, yes.
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: