Message/Author 

Anonymous posted on Thursday, November 20, 2003  10:48 pm



Many multilevel books start with a unconditional model. That is, there is no level1 and level2 predictor. Level one model Y_ij = b_0j + e_ij Level two model b_0j = r00 + u_0j This model is a very simple model. How can I set this model in MPLUS ? I didn't specify any variable in "WITHIN" and "BETWEEN" commands because there is no predictor. WITHIN = ; BETWEEN = ; In model statement MODEL: %WITHIN% y ON ; %BETWEEN% y ON ; I think there is something wrong in my command file. Could you let me know how to set up this simple model in MPLUS ? 


Leave out the WITHIN and BETWEEN statements. And do the model as follows: MODEL: %WITHIN% y; %BETWEEN% y; 

Anonymous posted on Friday, November 21, 2003  1:04 pm



Thanks for replying I have another question. ****************** MODEL: %WITHIN% s  y ON x; %BETWEEN% y s; ****************** In a output I can get means and variances for y and s but I like to have a covariance between y and s. How can I get this one ? Thanks 


MODEL: %WITHIN% s  y ON x; %BETWEEN% y s; y WITH s; 

Anonymous posted on Saturday, November 22, 2003  9:57 am



In the MPLUS manual (page 3839) there are many estimators. I am wondering whether ML is the same as Full Maximum Likelihood or Restricted Maximum Likelihood. If ML in MPLUS is Full maximum likelihood estimator is there restricted maximum likelihood estimator in MPLUS ? SPSS or SAS has the two estimators (FML and REML). I am looking for the equivalent estimators in MPLUS. Thanks 


Fullinformation maximum likelihood. Mplus doesn't have REML. 

Anonymous posted on Saturday, November 22, 2003  10:31 am



When I check a loglikelihood value of HO in MPLUS this value is almost the same as one calculated by SPSS using REML method. Is the default estimator (MLR : maximum likelihood estimator with robust standard error) in MPLUS is similar to REML in other software ? *********************** other software MPLUS FML ML REML MLR *********************** If not, what is the difference between MLR in MPLUS and REML ? Thanks for the quick reply 

bmuthen posted on Saturday, November 22, 2003  10:51 am



The Mplus ML estimator is the same as FML (also called FIML). Mplus does not have REML. REML ("restricted ML") has been proposed with the aim of getting better variance estimates with small samples. You will probably see rather small differences between REML and ML (FML). The Mplus MLR estimator gives ML (FML) parameter estimates and robust SEs. Such SEs are also called sandwich or HuberWhite. The robustness is against nonnormality and model misspecification primarily. 

Helen Dennis posted on Tuesday, December 30, 2003  12:47 pm



I ran a null model in mplus using the format: MODEL: %WITHIN% y; %BETWEEN% y; To be sure that I was running what I thought I was running, I also ran the null model in HLM 5.0 with FIML. I got similar estimates for the intercept, but VERY different estimates for the level 1 and level 2 variances (much larger estimates in Mplus). Should I have expected this? If yes, Why? THANKS 

bmuthen posted on Tuesday, December 30, 2003  12:54 pm



Please send your HLM and Mplus outputs to support@statmodel.com 


I don't think that you have the same data for the two runs. HLM has 54 clusters and Mplus has 57. 

Sally Czaja posted on Friday, November 05, 2004  9:16 am



As in the 11/20/03 posting, I want to run an unconditional multilevel model. The dependent variable is dichotomous. Following the 11/21/03 advice, my commands include: ANALYSIS: TYPE IS twolevel ; ESTIMATOR IS mlr; MODEL: %WITHIN% Resi6o8A; %BETWEEN% Resi6o8A; OUTPUT: SampStat standardized; I get 2 error messages: *** ERROR in Model command Variances for categorical outcomes are not currently defined on the within level. Variance given for: RESI6O8A *** ERROR in Model command Variances for categorical outcomes can only be specified using PARAMETERIZATION=THETA with estimators WLS, WLSM, or WLSMV. Variance given for: RESI6O8A What should I be doing differently? Thanks. 

bmuthen posted on Friday, November 05, 2004  11:21 am



In 2level analysis of a binary variable, there is only a secondlevel variance to be estimated, not a firstlevel variance. So, delete Resi6o8A from the Within part of the model. 

Vera posted on Saturday, December 17, 2005  12:15 pm



I am also trying to run the unconditional means model using the syntax you provided. However, I get the following message: *** ERROR in Model command Unknown variables: %WITHIN% in line: %WITHIN% What am I doing wrong? Here's what I entered: DATA: FILE IS anx.dat; VARIABLE: NAMES ARE y; MODEL: %WITHIN% y; %BETWEEN% y; THANKS! 

bmuthen posted on Saturday, December 17, 2005  1:01 pm



Please send your output and license number to support@statmodel.com. 

Anonymous posted on Friday, March 03, 2006  8:38 am



I noticed the above discussions regarding REML and Mplus. I'm wondering if Mplus 4.0 now allows REML for multilevel models ? 


No, Mplus does not have REML. Typically REML is not that different from ML unless samples are very small. 

mmm posted on Tuesday, June 19, 2007  10:32 am



I am comparing variance estimates between my null model and one with fixed individual level predictors (no between). The variance estimate for my null model is smaller compared to the second model mentioned above with predictors. The response variable is dichotomous. Seems counterintuitive since I am adding predictors, one would expected variances to decrease. Is this something you have seen before? Thank you. 


I think it would be unusual for this to happen but it could. The model with covariates is more stable than one without covariates. Therefore, the one without may have larger sampling variability. 


I trying to run the following model: Model: exe by q20* q21 q22 q23 q24; exe@1; q21@0; postfit on exe gender peduc d1 d2; exe on d1 d2; and I keep getting this error message: Variances for categorical outcomes can only be specified using PARAMETERIZATION=THETA with estimators WLS, WLSM, or WLSMV. Variance given for: Q21 The residual variance for this variable is negative and I would like to set it to zero because otherwise the model fits great. 


With categorical outcomes there is in general not a free parameter for a residual variance of a factor indicator because it cannot be identified as a separate parameter. Exceptions are multiplegroup modeling and longitudinal modeling. The negative residual variance that you see is computed as a function of other parameters. Therefore it is not easy to fix or constrain to be positive. Typically a negative residual variance is an indication that something is wrong with the model so that it should be modified. For example, is the exe factor really unrelated to gender and peduc? 


Dear Linda or Bengt, I am comparing the estimation of an empty or unconditional 2 level model (no covariates  just variance decomposition) between different software packages. HLM and Mlwin give me very similar results whereas Mplus is doing something differently. Overall, Mplus gives me higher estimates for the within and between variances and SE. Can you please explain me why this is happening? Thank you, Eva 


If you have the same data, the same sample size, the same model, and the same estimator, the three programs will give the same results. I would check these three things first. Otherwise I would need to see the three outputs and your license number at support@statmodel.com. 


Dear Linda or Bengt, I am trying to discern if it is possible to use Mplus to run a metaanalysis. I am able to run an unconditional random effects model in HLM, using the VKnown feature. The VKnown feature, the level1 variance of the model is treated as "known", such that: Level one model Y_ij = b_0j + e_ij where e_ij = "known" sampling variance derived from each study Level two model b_0j = r00 + u_0j Thanks for your help. 


You can do that as in http://statmodel.com/download/webnotes/mc3.pdf with random slopes on a covariate = sqrt(variance). It is important to define the random slope as a within level variable and use 2 dimensional numerical integration. 


Dear Linda or Bengt, I would like to know if it is possible to specify an unconditional twolevel model in which the y is a latent variable (y by x1 and x2). How to deal with the fact that withinlevel variables cannot by used on the between level? MODEL: %WITHIN% y on x1 x2; %BETWEEN% y on x1 x2; Thank you very much in advance. 


If you don't put a variable on either the BETWEEN or WITHIN lists, the variable can be used on both levels. See Example 9.1 for a more detailed explanation. Note that a factor with two indicators is not identified. 

Utkun Ozdil posted on Thursday, April 28, 2011  12:42 pm



Hi, I'm analyzing a twolevel structural equation model with categorical outcomes. While testing the unconditional model my syntax is as below in its simplest form: VARIABLE: NAMES ARE class q1q8 USEVARIABLES ARE class q1q8; CATEGORICAL ARE q1q8; CLUSTER IS class; ANALYSIS: TYPE IS TWOLEVEL; ESTIMATOR IS WLSM; MODEL: %WITHIN% fw BY q1 q3 q2 q4; aw BY q5 q6 q8 q7; %BETWEEN% fb BY q4 q2 q1 q3; ab BY q8 q6 q7 q5; OUTPUT: SAMPSTAT STANDARDIZED; In order to report how much of the total variance is attributable to the withinlevel and to the betweenlevel partially, are we going to use the "Variances" section for the latent variables fw,aw,fb,and ab? Or are we to request something else in the OUTPUT command? Thanks in advance... 


For the factors, you would need to hold the factor loadings equal across between and within. This may not make sense. If it does, the model estimated variances of the factors would show you the within and between parts. 

Utkun Ozdil posted on Friday, April 29, 2011  10:30 am



I have the estimated variances of the latents for the within and between parts. I calculated the ICCs for these latents by hand. In some articles the variance attributed to the withinlevel and betweenlevel are reported in percentages partially. I expected to find these percentages in my output but I think Mplus does not provide these values? And my last question is about twolevel EFA. The Mplus output did not display the variances accounted for by each factor though the eigenvalues are demonstrated. Is there a specific calculation or a command to obtain these percentages? Thanks... 


No, we don't provide these percentages. We also don't provide the variances account for by each factor. 

MKS posted on Tuesday, July 26, 2011  8:34 am



I would like to compare two nonnested models with each other. What options i have except AIC and BIC? Thanks for your help. 


None that I know of. 

Joe King posted on Saturday, November 12, 2011  4:00 pm



when doing the full unconditional model is OK to just leave the model statement blank and have the outcome variable in the place where i specify the count model (its a ZINB model). also how would one get an estimate of ICC in a two level ZINB model? 


I think you need to mention the variable name in the MODEL command, but try it. ICC is a tricky concept with counts because there is no withinlevel variance parameter. 


Dear Professor Muthen Is it possible to use the HuberWhite Sandwitch Estimator in Mplus and if so what is the command for it? Thank you so much, Monica 


Yes, use the MLR estimator. ESTIMATOR=MLR; in the ANALYSIS command. 

kirsten way posted on Monday, September 03, 2012  1:06 am



Hi, I've run an unconditional model with the syntax below and the output is stating df=0. Shouldn't the degrees of freedom be related to the number of groups (i.e. for me, 75)? This is the syntax I have used below VARIABLE: NAMES ARE ORGID WKGRPID ID TC RC AgYld AgColl AgFce AgAvd anxdep wellbeing harass1; USEV ARE WKGRPID harass1; CLUSTER IS WKGRPID; ANALYSIS: TYPE IS TWOLEVEL; MODEL: %WITHIN% harass1; %BETWEEN% harass1; OUTPUT: STDYX; *** WARNING in MODEL command Variable is uncorrelated with all other variables: HARASS1 *** WARNING in MODEL command All least one variable is uncorrelated with all other variables in the model. Check that this is what is intended. 


The degrees of freedom are related to the number of parameters in the H1 model versus the number of parameters in the H0 model. In your case these are the same so the degrees of freedom are zero. 


Hello, I'm running an unconditional means model to get percentage of variance at the within and between level. I wanted to use the B/(B+W) formula for this using the unstandardized variance estimates but I get a between level variance of .000. However the output shows an ICC of .015, I'm wondering if I'm using the wrong information from the output to calculate the variance or if I'm doing something wrong 


The icc's we give are based on the sample variances not the model estimated variances. I think this is what you are seeing. 


Thanks for your quick response! So what I'm getting from your response is that the percentage of variance that I want to calculate and the ICCs that Mplus provides are somewhat different things, is this correct? If that's the case, where can I find the variance estimates needed to calculate the percentage of variance explained? Is it the unstandardized variance estimates or should I be looking somewhere else? 


We compute ICC's using sample statistics. You are using model estimated values. The percentage of variance explained, Rsquare, is one minus the standardized residual. This is not related to ICC's. 


I'm not sure I made myself clear. I'm trying to calculate percentage of variance explained of a variable at the between and the within level, not the percentage of variance explained of a dependent variable by an independent variable. 


You can do a TYPE=TWOLEVEL BASIC to get the within and between variances that we use to compute ICC's. 

anonymous Z posted on Tuesday, February 17, 2015  8:44 am



Dr Muthens, I am working on data of small sample size. I have outcome variables that are dichotomous. I fit several growth models. As you can imagine, the results do not look good. I wondered if you have any general advice about working with small data set using Mplus. For instance, Mplus doesn’t’ have REML. Given REML matters when sample size is small, what will be an alternative way to improve the estimate? Thank you very much, 


You can consider Bayes estimation. 

anonymous Z posted on Tuesday, February 17, 2015  9:42 am



Dr. Muthen, Thank you very much for your prompt response. What is the Mplus command it is? Thanks, 


ESTIMATOR=BAYES. See pages 604605 and631636 in the user's guide and examples in Chapter 11. 


Dr Muthen, In an earlier post on this page someone asked about just trying to obtain the amount of variance explained in a variable at the within and the between level. Linda responded that the person could "do a TYPE=TWOLEVEL BASIC to get the within and between variances that we use to compute ICC's." I am trying to follow Bliese & Ployhart's 2002 approach to run the null model (i.e., with no random intercept or other random effects added) before I move on to adding time and/or random effects. The approach calls for comparing model fit as you add complexity. If I use the TWOLEVEL BASIC command, I am confused about what I put on the %Between% and %Within% statements. Thank you! Bliese, P., & Ployhart, R. (2002). Growth Modeling Using Random Coefficient Models: Model Building, Testing, and Illustrations. Organizational Research Methods, 5, 362387. 


With Type=Twolevel Basic you don't specify a %Between% and %Within% model. The Basic analysis uses a model with random intercepts for each outcome. I am not familiar with the Bliese article. 

Hongguo Wei posted on Sunday, February 19, 2017  8:30 pm



Dear Dr. Muthen, I am studying leaderfollower dyads at work groups. I need to examine the nonindependence of variables and see whether I can analyze them at the individual, dyadic, or group levels. Can I use the three level unconditional mean model to calculate the within (individual) and between variances (dyad and group), and thus get ICC1s at both the dyad and group levels? May I just use TYPE=Threelevel Random to get the variance at three levels? Thank you very much! 


You can do that if you have enough units on the 2 highest levels (say > 30). 

Back to top 