Message/Author 

shige song posted on Thursday, April 15, 2004  12:53 am



I am trying to estimate a simple twolevel model using Mplus where the first level model is intercept only and the secondlevel model has a couple of covariates. Here is what I did: ... Model: %within% marry on; %between% marry on b2p btp; ... but it did not work. I guess I need to put something in the "within" section after the "on" but I have not figured out what to put there. Thanks! Shige 


The following should work. If you have no regression on the within level, then you do not need an ON statement. ON statements are used to describe regression relationships. You can just mention the variance of marry. You will automatically get the means on the between level as the default. I think the following will work. Model: %within% marry; %between% marry ON b2p btp; 

shige song posted on Thursday, April 15, 2004  11:13 am



Hi Linda, I still get this erro message:  *** WARNING in Model command Variable is uncorrelated with all other variables on the WITHIN level: MARRY *** WARNING in Model command All least one variable is uncorrelated with all other variables in the model. Check that this is what is intended. 2 WARNING(S) FOUND IN THE INPUT INSTRUCTIONS Stata2Mplus convertsion for D:\DATA\cc82\marry20fr.dta List of variables converted shown below unit : Province, Prefecture, and County marry : birth_2nd_p2 : proportion of second or higher birth (b) birth_total_p2 : *** FATAL ERROR Internal Error Code: GH1006. An internal error has occurred. Please contact us about the error, providing both the input and data files if possible.  The complete code I used for this model is:  Title: Stata2Mplus convertsion for D:\DATA\cc82\marry20fr.dta List of variables converted shown below unit : Province, Prefecture, and County marry : birth_2nd_p2 : proportion of second or higher birth (b) birth_total_p2 : Data: File is D:\DATA\cc82\marry20fr.dat ; Variable: Names are unit b2p btp marry; cluster is unit; categorical = marry; between = b2p btp; Missing are all (9999) ; Analysis: Type = twolevel ; algorithm = integration; Model: %within% marry; %between% marry ON b2p btp;  It looks like mplus does not like the absence of levelone covariates, or maybe I still did not get something right. Thanks for the help! Shige 


That is not an error message. It is just a warning to make you aware of the situation. Look at your results. If you are getting all of the parameters that you want, then you are fine. 

shige song posted on Thursday, April 15, 2004  11:37 am



There is also the "*** FATAL ERROR Internal Error Code: GH1006. An internal error has occurred. Please contact us about the error, providing both the input and data files if possible.", and I got no other output there. 

bmuthen posted on Thursday, April 15, 2004  11:39 am



Please do as suggested  send input, output, and data to support@statmodel.com 

shige song posted on Thursday, April 15, 2004  11:53 am



Thanks, I will do that. Shige 

Anonymous posted on Friday, July 30, 2004  2:48 pm



Dear Dr. Muthen, I have a question about the covariates for the multilevel analysis. There is the same regression on the covariates in both within level and between level. For example: %WITIN% y1 on x1 x2; %BETWEEN% y1 on x1 x2; My question is that how do you carry out the regression in the within level into the between level since the within level is nested into the between level. I hope my question is clear enough. Thank you very much for your time and advice. 

bmuthen posted on Friday, July 30, 2004  5:35 pm



I am not sure I understand the question, but let me say what your model states. All 3 variables have both within and between variation. The intercept in the regression of y1 on the x's varies across between and in the between part of the model this intercept variation is described in terms of the between variation of the x's. Let me know if this doesn't answer your question. 


Dear Drs. Muthen: I am trying to run the following 2level model. Level 1: Yij = B0j + B1jX1 + rij Level 2: B0j = B00 + B01Wj + u0j B1j = B10 + B01Wj Please note that I want to model the effect of W on B1j but I do not want to include the error term (u1j) in the equation. However, I can't seem to figure out how to model effect of W on B1j at Level 2 w/out making B1j a random effect, such that "s" on W can be included in L2 syntax. The syntax that I am using is: %WITHIN% s y ON x; %BETWEEN% y s; y s on W; Is there a way to model effect of W on B1j such that there is no error termu1j? Thank you for your assistance. Anne 


On the between level, say: s@0; 


Dear Dr, Muthen; I have a similar question. I have cases nested within three locations and have used fixed dummies for the location, since I was not intested in modeling the between location variations. One of the reviewers for my paper wants me to estimate a multilevel path model. So I don't have any level 2 variables and was wondering if it would make sense to run a model using the following syntax.. %within% y on x1 x2; u on y x2; %between% y u; when I run a model, it gives me some outputs along with the following warnings. SERIOUS PROBLEM IN THE OPTIMIZATION WHEN COMPUTING THE POSTERIOR DISTRIBUTION. CHANGE YOUR MODEL AND/OR STARTING VALUES. THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO AN ERROR IN THE COMPUTATION. CHANGE YOUR MODEL AND/OR STARTING VALUES. Thank you. 


You can't run a multilevel model with only three clusters, locations. You need a minimum of 2030 clusters to do this. Your approach of using dummy variables is correct. 

Steven John posted on Friday, April 08, 2016  12:28 am



Dear Professors, I use nested data (student  teachers) and am running a twolevel model where focus is on the between level. Basically I just want to model the realtionships at between level. X1 to X3 are between level variables, while In1, In2 and TEST is at both levels. How should I treat the variables that vary on both levels in order to account for the within level variance? Could I formulate the model like is made below? Also, does is make sense to estimate a twolevel model in cases where focus is on one level only – would it simply be better to aggregate nested data with within level variation and run anayses at one level only (Between level). %WITHIN% In1 In2 TEST; %BETWEEN% MOT BY X1 X2 X3 In1 In2; TEST ON MOT; 


I think you could simply aggregate and do singlelevel. 

Back to top 