Message/Author 


Hi, I am trying to run a 2level mediation model  I copied it directly from syntax provided by Preacher (http://www.quantpsy.org/pubs/syntax_appendix_081311.pdf), using the 111 model with random slopes, and am running into some problems: When I first tried to run the model, I got a fatal error message: "THIS MODEL CAN BE DONE ONLY WITH MONTECARLO INTEGRATION." I then inserted ALGORITHM = INTEGRATION and INTEGRATION=MONTECARLO into the analysis section, but again I got a series of error messages (for both my x and my mediator): " *** ERROR in MODEL command Observed variable on the righthand side of a betweenlevel ON statement must be a BETWEEN variable. Problem with: T1GMOT1" Any suggestions for how I can fix this? Thank you for your help! 


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


Hi, I am having a similar problem to the one described above when running the 111 MSEM with random slopes model provided by Preacher et al (2010). I have narrowed the problem down to the lines of syntax at the beginning of the %between% section, where estimates for the variances and covariances are requested. If I add the independent (x) variable to any of these statements, I get the fatal error message: "THIS MODEL CAN BE DONE ONLY WITH MONTECARLO INTEGRATION." If I remove the x variable the model runs normally (although I do get a warning that estimation has reached a saddle point). I would greatly appreciate any guidance on how to deal with this. Thank you very much. 


Have you tried running it as suggested ALGORITHM = INTEGRATION; INTEGRATION = MONTECARLO; 


Thank you for the prompt response, Bengt. If I run it with Monte Carlo integration I get the following error message: *** ERROR in MODEL command Unrestricted xvariables for analysis with TYPE=TWOLEVEL and ALGORITHM=INTEGRATION must be specified as either a WITHIN or BETWEEN variable. The following variable cannot exist on both levels: X X is a withinlevel variable. However, if I specify it as such, then I cannot use it on the between level as is needed to carry out the Preacher et al syntax. Thanks again for your help. 


You can create a clusterlevel variable for x using the CLUSTER_MEAN option of the DEFINE command and use this on between. 


I am having a similar issue as posted on June 27. If I create the clusterlevel variable using cluster_mean option, do I include the newly created variable in place of the original variable in my analysis? Or do I retain the original? *** ERROR in MODEL command Betweenlevel variables cannot be used in random slope definitions on the within level. Betweenlevel variable used: CLUSMEAN 


Q1Q2. You can use both if you like. The error message says that you have put clusmean on the Between list but use it on Within. If this doesn't help, send output to Support along with your license number. 


Dear Prof. Muthen I'm fitting a 111 multilevel mediation model with a binary outcome (y=transition to higher education), continuous mediator (m=standardised test scores), and three dummy variables for parental educational levels (x1, x2, x3). As all variables were measured at the individual level, thereby I've specified the x's variables in the WITHIN part. The cluster of schools is associated with the mediator only. For this model (random intercepts) I don't have BETWEEN variables, at the school level. I'm getting the following warning message for the y and m A yvariable has been declared on the within level but not referred to on the between level. Please check that this is what is intended. If this is not intended, specify the variable as a within variable. Problem with: y & m Do I need to specify the outcome (y) in the WITHIN part or it is correct as it is? CATEGORICAL = y; WITHIN = x1 x2 x3; CLUSTER = sch; ANALYSIS: ESTIMATOR = MLR; LINK = PROBIT; MCONV = 0.00001; INTEGRATION = MONTECARLO(250); ALGORITHM = EM; CHOLESKY = OFF; TYPE = TWOLEVEL; MODEL: %WITHIN% m ON x1 x2 x3; y ON m x1 x2 x3; 


You want to add Betweenlevel variances for y and m, e.g. by saying y WITH m; Y also has a betweenlevel variance, showing the variation across schools in the proportion that transitioned to higher ed. 


Thank you. By adding the betweenlevel variances for y and m, I'm not getting that warning message anymore. In the case of a random slope model, for the same variables, I'm getting this error message THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO A CHANGE IN THE LOGLIKELIHOOD DURING THE LAST E STEP. AN INSUFFICENT NUMBER OF E STEP ITERATIONS MAY HAVE BEEN USED. INCREASE THE NUMBER OF MITERATIONS OR INCREASE THE CONVERGENCE VALUE. ESTIMATES CANNOT BE TRUSTED. SLOW CONVERGENCE DUE TO PARAMETER 11. THE LOGLIKELIHOOD DERIVATIVE FOR THIS PARAMETER IS 0.24415009D+02. Parameter 11 is the slope 'sa2' (sa2  m ON x2;) in the matrix PSI. Considering that the problem in the estimation could be related to this other warning message *** WARNING One or more individuallevel variables have no variation within a cluster for the following clusters. Variable Cluster IDs with no withincluster variation The number of clusters with no withincluster variation are (as shown in the output) 370 for y 78 for m 587 for x1 2,120 for x2 2,932 for x3 All of them from a total of 5,653 schools and 121,088 students. Do you think random slopes could not be feasible in this model? 


I would need to see your full output with TECH8 to conclude. You can send to Support along with your license number. 

Yoosun Chu posted on Tuesday, August 08, 2017  4:04 pm



Hello, I ran twolevel CFA with ordinal indicators using WLSMV estimation. I have one warning: WARNING One or more individuallevel variables have no variation within a cluster for the following clusters. I think that I have enough ICC. Could you give any thoughts? Thanks. 


This warning message was added in Version 8 with the main intention to guide analysis of longitudinal data. With such data, level 1 represents time and level 2 represents subject. It is therefore important to know if a subject does not vary across time. In other context such as students observed in clusters such as schools, this message may appear when cluster sizes are relatively small and/or when the variable in question is binary representing rare events. It is not known to which extent this influences the quality of estimation. Nevertheless, it would seem important to be aware if a large number of clusters have this warning for a key outcome variable. 

Yoosun Chu posted on Tuesday, August 08, 2017  5:07 pm



Thank you for the prompt answer. I have 37 leveltwo clusters, not large but enough for the multilevel analysis I guess. Do you think this might affect the anlysis? Thanks! 


37 clusters should be enough. Unless the warning message says that a key outcome has no variation in many/most clusters. 

Back to top 