Unconditional model
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 level-1 and level-2 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 ?
 Linda K. Muthen posted on Friday, November 21, 2003 - 6:21 am
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

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
 Linda K. Muthen posted on Friday, November 21, 2003 - 4:59 pm
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 38-39) 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
 Linda K. Muthen posted on Saturday, November 22, 2003 - 10:23 am
Full-information 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 ?

 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 Huber-White. The robustness is against non-normality 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
 Linda K. Muthen posted on Tuesday, December 30, 2003 - 3:47 pm
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 multi-level 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 2-level analysis of a binary variable, there is only a second-level variance to be estimated, not a first-level 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
 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 ?
 Linda K. Muthen posted on Friday, March 03, 2006 - 9:32 am
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.
 Linda K. Muthen posted on Tuesday, June 19, 2007 - 5:49 pm
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.
 Stephanie Fitzpatrick posted on Friday, May 29, 2009 - 9:09 am
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.
 Bengt O. Muthen posted on Friday, May 29, 2009 - 9:23 am
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 multiple-group 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?
 Eva Van de gaer posted on Tuesday, February 23, 2010 - 10:17 pm
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
 Linda K. Muthen posted on Wednesday, February 24, 2010 - 6:01 am
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.
 Paul R. Hernandez posted on Monday, March 29, 2010 - 3:25 pm
Dear Linda or Bengt,

I am trying to discern if it is possible to use Mplus to run a meta-analysis. I am able to run an unconditional random effects model in HLM, using the V-Known feature. The V-Known feature, the level-1 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

 Tihomir Asparouhov posted on Tuesday, March 30, 2010 - 1:38 pm

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.
 Roza Meuleman posted on Tuesday, May 04, 2010 - 6:23 am
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 within-level 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.
 Linda K. Muthen posted on Tuesday, May 04, 2010 - 9:50 am
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 two-level structural equation model with categorical outcomes. While testing the unconditional model my syntax is as below in its simplest form:
VARIABLE:
NAMES ARE class q1-q8
USEVARIABLES ARE class q1-q8;
CATEGORICAL ARE q1-q8;
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 within-level and to the between-level 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?
 Linda K. Muthen posted on Friday, April 29, 2011 - 9:16 am
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 within-level and between-level 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 two-level 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...
 Linda K. Muthen posted on Friday, April 29, 2011 - 11:13 am
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 non-nested models with each other. What options i have except AIC and BIC?
 Linda K. Muthen posted on Tuesday, July 26, 2011 - 12:40 pm
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?
 Bengt O. Muthen posted on Saturday, November 12, 2011 - 4:59 pm
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 within-level variance parameter.
 Monica Torreiro-Casal posted on Tuesday, June 05, 2012 - 5:08 am
Dear Professor Muthen

Is it possible to use the Huber-White Sandwitch Estimator in Mplus and if so what is the command for it?

Thank you so much, Monica
 Linda K. Muthen posted on Tuesday, June 05, 2012 - 11:44 am
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.
 Linda K. Muthen posted on Monday, September 03, 2012 - 6:15 am
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.
 Manuela Jimenez posted on Monday, September 30, 2013 - 3:17 pm
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
 Linda K. Muthen posted on Monday, September 30, 2013 - 3:48 pm
The icc's we give are based on the sample variances not the model estimated variances. I think this is what you are seeing.
 Manuela Jimenez posted on Tuesday, October 01, 2013 - 2:27 pm
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?
 Linda K. Muthen posted on Tuesday, October 01, 2013 - 2:57 pm
We compute ICC's using sample statistics. You are using model estimated values. The percentage of variance explained, R-square, is one minus the standardized residual. This is not related to ICC's.
 Manuela Jimenez posted on Tuesday, October 01, 2013 - 3:49 pm
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.
 Linda K. Muthen posted on Wednesday, October 02, 2013 - 12:04 pm
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,
 Linda K. Muthen posted on Tuesday, February 17, 2015 - 9:12 am
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,
 Linda K. Muthen posted on Tuesday, February 17, 2015 - 2:03 pm
ESTIMATOR=BAYES. See pages 604-605 and631-636 in the user's guide and examples in Chapter 11.
 Sharon Sheridan posted on Friday, January 29, 2016 - 2:05 pm
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, 362-387.
 Bengt O. Muthen posted on Friday, January 29, 2016 - 6:02 pm
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 leader-follower 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!
 Bengt O. Muthen posted on Monday, February 20, 2017 - 6:15 pm
You can do that if you have enough units on the 2 highest levels (say > 30).
 Lauren Florko posted on Thursday, September 28, 2017 - 12:16 pm
I am trying to run a null model:
MODEL:
%WITHIN%
y;
%BETWEEN%
y;

and I'm getting the error message [truncated for size]:

THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO AN ILL-CONDITIONED FISHER INFORMATION MATRIX..

THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO A NON-POSITIVE DEFINITE FISHER INFORMATION MATRIX. THIS MAY BE DUE TO THE STARTING VALUES BUT MAY ALSO BE AN INDICATION OF MODEL NONIDENTIFICATION..

THE STANDARD ERRORS OF THE MODEL PARAMETER ESTIMATES COULD NOT BE COMPUTED...PROBLEM INVOLVING THE FOLLOWING PARAMETER:... %BETWEEN%: y

A MATRIX COULD NOT BE INVERTED DURING THE H1 MODEL ESTIMATION (same with baseline). THE ESTIMATED WITHIN COVARIANCE MATRIX IS NOT POSITIVE DEFINITE AS IT SHOULD BE. COMPUTATION COULD NOT BE COMPLETED. THE VARIANCE OF y APPROACHES 0. FIX THIS VARIANCE AND THE CORRESPONDING COVARIANCES TO 0, DECREASE THE MINIMUM VARIANCE, OR SPECIFY THE VARIABLE AS A BETWEEN VARIABLE.

THE H1 MODEL ESTIMATION DID NOT CONVERGE. CHI-SQUARE TEST AND SAMPLE STATISTICS COULD NOT BE COMPUTED.

THE BASELINE MODEL ESTIMATION DID NOT CONVERGE. THE CHI-SQUARE VALUE COULD NOT BE COMPUTED.
 Bengt O. Muthen posted on Thursday, September 28, 2017 - 2:44 pm
 Laura Alexandra posted on Tuesday, December 19, 2017 - 7:40 am
Dear Mr/Mrs. Muthen

I apply a latent-growth curve model in a multilevel context (cluster regio1) and want to control standard errors further for the complex survey design (cluster idclass1).

Are the following aspects of the code ok? & can I partition the variance at within (idstud) & between level (regio1) even though I correct for clustering due to the survey design (idclass1)?

many thanks!

CLUSTER is idclass1 regio1;
stratification is stratum1;
weight is corewgt;

ANALYSIS:
TYPE IS COMPLEX TWOLEVEL;

MODEL:

%WITHIN%
! LGM for school achievement
id sd | germ2@0 germ3@0.73 germ4@1 ;

!non-sign. cov
sd with id@0;

%BETWEEN%
idb sdb | germ2@0 germ3@0.73 germ4@1 ;
sdb with idb@0;
 Bengt O. Muthen posted on Tuesday, December 19, 2017 - 3:54 pm
Yes.
 Laura Alexandra posted on Friday, February 23, 2018 - 12:04 am
Dear Mr./Mrs Muthén

I have a few follow up question to the model:

CLUSTER is idclass1 regio1;
stratification is stratum1;
!corewgt;

ANALYSIS:
TYPE IS COMPLEX TWOLEVEL;

idclass1 (primary sampling units - PPS sampling). I am however interested in the second level of school districts (regio1) and just want to control standard errors for the sampling design clusters (idclass1).

The survey weight is sort of a total weight, but: the within-weight is mainly 1 for everybody (complete classrooms were surveyed & almost no non-response existed, hence the survey weight(corewgt) mainly mirrors differences in between classroom selection probabilities due to PPS). However the survey weight has nothing to do with regio1 (second level cluster of analysis) since it mirrors the design cluster (idclass1) selection. What should I do in this situation? I i) run and report the analysis without weights and then ii) I calculated averages of the corewgt across school districts(regio1) to mirror approximately over-and undersampling across school districts and included the survey weight as bweight (between weight) to check if results remain the same, which is the case...

Another question refers to the TLI, which is 1.47 (should I be concerned ?)

Many thanks for your appreciated support!!
 Tihomir Asparouhov posted on Friday, February 23, 2018 - 4:43 pm
I think you should use
bweight=corewgt;

For TLI see