Message/Author 

Anonymous posted on Thursday, November 03, 2005  11:35 am



I'm interested in simulating a multilevel SEM. I want to control my Intraclass correlations. How would I do that in Mplus? In other words, what syntax would I use? If I missed an example in the manual, please tell me the number. Also, is there any way to have the "results" option of Monte Carlo provide the ICC's? Thanks so much. 


I am going to use Example 11.4 to describe this. An intraclass correlation is the ratio of between variability to total variability. So you increase the intraclass correlation by increasing between level variability. For example, consider y1. It's betweenlevel variation is the same as the variability of ib because centering is done at time one. The withinlevel variance of y1 is the same as the iw variance plus the y1 residual variance. Using this example, the intraclass correlation for y1 is 0.2/(0.2 + 1 + 0.5) = .12. ICC's are not saved. 


Dr. Muthen, I want to simulate a multilevel CFA model. In within model, I have 6 indicators (y1y6). Half of them(y1y3) were predicted by a latent variable, namely, fw1; half(y4y6) were predicted by fw2. In between model, I have the same factor structure. Half of them(y1y3) were predicted by a latent variable, namely, fb1; half(y1y3) were predicted by fb2. Q1. What is the syntax to set ICC to be equal to .25? Q2. Are the reliabilities of each indicator in between model necessarily larger than the reliabilities in within model? Is there any suggestion/reference when I set the residuals of each indicator in between model? Your response is much appreciated. Best, HsienYuan Hsu 


Q1. ICC is the between variance divided by the between plus within variances. So adjusting the between variance changes the ICC. See the input from the Mplus CD for Example 11.4. There are comments related to ICC's. Q2. I think this is usually the case. I don't know of any reference. 


Hi Linda, I just wanted to follow up on these questions and responses, which have been most helpful. If I'm simulating multilevel data and want to manipulate the ICC's for the latent variable, could I just do that by specifying the between and within variances for it only, or would I also need to do so for the individual indicators as well? I'm thinking of a case where I want the ICC=.25, for example. It seems to me that I could set the within variance=.25 and between=.75 for the latent variable and generate what I need. Does that logic seem sound? Thanks. Holmes 


The icc's for the latent variable would also require information about the residual variances of the factor indicators. 


Linda, Thanks very much. I always appreciate your very quick responses. Holmes 


I'm interested in simulating multilevel data("disaggregated approach", per Bengt's earlier work) and then analyzing these data such that grouping is nuisance ("aggregated approach" per Bengt's earlier work....robust ML, group = cluster). Specifically, I would like to simulate a simple 2 level model in which person level data (level 1; Sw) are predicted by a single group level (level 2; Sb) predictor (e.g,. child outcomes predicted by treatment that is assigned at classroom level). Questions: 1. Can you point me to example code where this has been done? 2. When defining population values in the monte carlo study, should the group level effect be included in within (Sw), between (Sb), or both levels models? Thank you. 


All of the examples in Chapter 9 have Monte Carlo counterparts that were used to generate the data. I would suggest using an example closest to what you are doing as a starting point. 


Hi, I'm interested in simulating a multilevel, multigroup IRT model in which I control the intraclass correlations for one or more of the observed indicator variables. I've looked through several examples and can't quite see how to put that together. Could you steer me in the right direction? Thanks very much. Holmes 


You can combine the Monte Carlo counterparts of Example 9.11 which is a twolevel multiple group CFA with continuous factor indicators and Example 5.5 which is an IRT model. In Example 9.11, you will need to use the KNOWNCLASS option and TYPE=MIXTURE instead of the GROUPING option. 


Linda, Thanks very much. I have one other question. Is it possible to assign the size of each of the latent classes analogous to using the ngroups and nobservations options for observed group sizes? Thanks very much. Holmes 


You need to do that using the means of the latent class variable and then an observed variable that is the same as the latent variable. See the Monte Carlo counterpart of Example 8.8 which has a KNOWNCLASS variable. 


Thanks very much. 

QianLi Xue posted on Monday, October 11, 2010  4:26 pm



Hi, if I want to simulate a dataset based on a latent class model, say, with 4 classes. How can I specify latent class prevalence parameters in the Monte Carlo step? Could you please elaborate on your answer to the similar question above? 


These are specified using a bracket statement for the means of the categorical latent variables. The population parameter values are in a logit scale where logit = log (probability of being in a particular class divided by the probability of being in the reference class) 

QianLi Xue posted on Monday, September 19, 2011  3:48 am



Hi, I would like to simulate multilevel cox regression model. I'm using your example 12.10. Could you tell me how to specify the degree of ICC? 


ICC is directly related to the model parameters only for normally distributed variables in principle and not for survival variables. So it is not possible to enter ICC directly in the simulation. The ICC will increase as you increase the total variance of the random intercept. Consider the model below similar to example 12.10 %BETWEEN% w@1 (var1); t ON w*.2 (beta); t*1 (var2); This gives a random intercept variance of var2+beta*beta*var1 You can increase any of the 3 parameters to get higher random intercept variance and higher ICC for the observed T. For each set of parameters compute the ICC of the generated data until you get to the right level (guess and check approach). 

QianLi Xue posted on Wednesday, September 21, 2011  12:49 pm



Thanks so much! 


Hello, I am considering using Mplus for an upcoming research project, but I am not sure whether the program has the features I need, especially since I have just started working with the program. I would like to use a Monte Carlo approach in order to simulate and analyze threelevel nested data drawn from a population with specified fixed effects, random effects, interaction effects, potential heteroscedasticity, measurement invariance or dropout patterns for longitudinal data, or other characteristics. I was wondering to what extent it is possible to draw the data directly from a hypothetical population via variancecovariancematrix, or use an alternative approach that does not require actual data set creation. I read some publications for twolevel models (e.g. Muthén & Muthén, 2002), but have not come across applications for threelevel (longitudinal) models. Are such simulations feasible in Mplus, or can you maybe suggest an alternative approach for my research purposes? Thank you very much! Denise Kerkhoff 


It seems that Mplus could do that. Mplus would generate raw data for analysis in such a case. 3level simulations are shown for all our 3level examples in the User' Guide which are posted on our website. 

MS, Kim posted on Monday, November 27, 2017  6:46 am



Hello. I have the questions. I want to simulate multilevel mediation in MSEM. McNeish(2017) said that it is impossible to simulate “211 model ” in mplus. Is it right? then, now can I simulate 121 model or 221 model? or can I simulate only 111 model? Thank you very much! 


It is possible to simulate these models in Mplus. What is the full reference to that paper? 

MS, Kim posted on Monday, November 27, 2017  5:44 pm



Thank you for your help!, seriously!. the full reference is ' McNeish, D. (2017). Multilevel mediation with small samples: A cautionary note on the multilevel structural equation modeling framework. Structural Equation Modeling: A Multidisciplinary Journal, 24(4), 609625.'. It is written that ' ~ the MONTECARLO utility in Mplus is not available for 211 mediation models and MCMC estimation ~.... ~We sued the X command to call mplus as a DOS prompt form SAS when necessary. ~' in 618 page. Then, Do you mean I can simulate to 211, 121, or 221 model by changing your example 11.11 ? Thanks very much. 


There is no problem modifying ex 12.11 to match equations (1a2c). I will send you the runs. 


Here is the 211 modification of User's Guide example 12.11 MODEL POPULATION: %WITHIN% b  y ON m; m*1; y*1; %BETWEEN% x*1; [x*1]; b*0.6; [b*0.4]; m on x*0.3; [m*0.5]; m*0.8; y on x*0.7; [y*2]; y*1.2; MODEL: %WITHIN% b  y ON m; m*1; y*1; %BETWEEN% x*1; [x*1]; b*0.6; [b*0.4]; m on x*0.3; [m*0.5]; m*0.8; y on x*0.7; [y*2]; y*1.2; 


Hi, I wonder why the ICC is not always calculated in multilevel models? I am doing a two level Monte Carlo study, and in some of my models I get ICC estimates for the included variables in the "summary of data for the first replication" but sometimes this field is empty? Best, Fredrik Falkenström 


Please send the output for when it doesn't show up to Support along with your license number. 


I'm running a MLM Monte Carlo simulation for a WITHIN latent variable predicting two DVs. I want to assume an ICC of .20 for each of the DVs, but I'm not entirely clear on the steps for declaring the ICC. Can you please explain how I would define the ICC for the model below (I've left out the DV variance)? Thanks! MONTECARLO: NAMES ARE y1y10 dv1 dv2; CSIZES=70(20); NOBS = 1400; NREPS = 100; SEED = 4533; NCSIZES =1; WITHIN ARE y1y10; ANALYSIS: TYPE IS TWOLEVEL RANDOM; PROCESSORS=2; MODEL POPULATION: %WITHIN% fW by y1*0.5 y2*0.5 y3*0.5 y4*0.5 y5*0.5 y6*0.5 y7*.50 y8*.50 y9*.50 y10*.50; fw@1; dv1 ON fw*.3; dv2 ON fw*.3; y1y10*.75; dv1dv2*1; %BETWEEN% dv1dv2@*; MODEL: %WITHIN% fW by y1*0.5 y2*0.5 y3*0.5 y4*0.5 y5*0.5 y6*0.5 y7*.20 y8*.20 y9*.20 y10*.20; fw@1; dv1 ON fw*.3; dv2 ON fw*.3; dep1*0.60; y1y10*.75; dv1dv2@1; %BETWEEN% dv1dv2*; 


You choose the Betweenlevel variance of your DV so that the ICC is what you want, where ICC = BetweenVar/(BetweenVar + WithinVar) 


Thanks. To clarify, if I want my ICC to be .20 for DV1, would I make the variance .25 [.25/(.25+1)] as written below, or do I need to include the regression coefficient of DV1 in the variance as well? MODEL POPULATION: %WITHIN% fW by y1*0.5 y2*0.5 y3*0.5 y4*0.5 y5*0.5 y6*0.5 y7*.50 y8*.50 y9*.50 y10*.50; fw*1; dv1 ON fw*.3; dv2 ON fw*.3; y1y10*.75; dv1dv2*1; %BETWEEN% dv1dv2*.25; MODEL: %WITHIN% fW by y1*0.5 y2*0.5 y3*0.5 y4*0.5 y5*0.5 y6*0.5 y7*.20 y8*.20 y9*.20 y10*.20; fw*1; dv1 ON fw*.3; dv2 ON fw*.3; y1y10*.75; dv1dv2*1; %BETWEEN% dv1dv2*.25; 


The dv1dv2*1 statement on Within refers to only the residual variance (this is the case because they are DVs)  you need their full variance which is influenced by the fw predictor. 

Back to top 