1-1-1 mediation model with random slopes PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
Message/Author
 Marina Milyavskaya posted on Wednesday, July 31, 2013 - 7:05 am
Hi,
I am trying to run a 2-level mediation model - I copied it directly from syntax provided by Preacher (http://www.quantpsy.org/pubs/syntax_appendix_081311.pdf), using the 1-1-1 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 right-hand side of a between-level ON statement must be a BETWEEN variable. Problem with: T1GMOT1"

Any suggestions for how I can fix this?
Thank you for your help!
 Linda K. Muthen posted on Wednesday, July 31, 2013 - 9:31 am
Please send the output and your license number to support@statmodel.com.
 Elizabeth Solberg posted on Monday, June 27, 2016 - 1:42 pm
Hi, I am having a similar problem to the one described above when running the 1-1-1 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.
 Bengt O. Muthen posted on Monday, June 27, 2016 - 7:35 pm
Have you tried running it as suggested

ALGORITHM = INTEGRATION;
INTEGRATION = MONTECARLO;
 Elizabeth Solberg posted on Monday, June 27, 2016 - 11:55 pm
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 x-variables 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 within-level 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.
 Linda K. Muthen posted on Tuesday, June 28, 2016 - 1:49 pm
You can create a cluster-level variable for x using the CLUSTER_MEAN option of the DEFINE command and use this on between.
 Kelly Kenzik posted on Saturday, January 07, 2017 - 4:17 pm
I am having a similar issue as posted on June 27. If I create the cluster-level 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
Between-level variables cannot be used in random slope definitions on the
within level. Between-level variable used: CLUSMEAN
 Bengt O. Muthen posted on Saturday, January 07, 2017 - 4:56 pm
Q1-Q2. 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.
 Alejandro Sevilla posted on Friday, May 19, 2017 - 8:17 am
Dear Prof. Muthen

I'm fitting a 1-1-1 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 y-variable 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;
 Bengt O. Muthen posted on Friday, May 19, 2017 - 11:35 am
You want to add Between-level variances for y and m, e.g. by saying y WITH m;

Y also has a between-level variance, showing the variation across schools in the proportion that transitioned to higher ed.
 Alejandro Sevilla posted on Friday, May 19, 2017 - 1:00 pm
Thank you. By adding the between-level 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 individual-level variables have no variation within a cluster for the following clusters.
Variable Cluster IDs with no within-cluster variation

The number of clusters with no within-cluster 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?
 Bengt O. Muthen posted on Friday, May 19, 2017 - 1:39 pm
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 two-level CFA with ordinal indicators using WLSMV estimation.
I have one warning:
WARNING
One or more individual-level variables have no variation within a cluster for the following clusters.
I think that I have enough ICC. Could you give any thoughts?
Thanks.
 Bengt O. Muthen posted on Tuesday, August 08, 2017 - 4:46 pm
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 level-two clusters, not large but enough for the multilevel analysis I guess. Do you think this might affect the anlysis? Thanks!
 Bengt O. Muthen posted on Wednesday, August 09, 2017 - 3:16 pm
37 clusters should be enough. Unless the warning message says that a key outcome has no variation in many/most clusters.
 Sabrina Twilhaar posted on Sunday, August 05, 2018 - 11:44 am
I am trying to run a 1-1-1 MSEM with random slopes.
X: preterm birth; 0, 1
There are some twins in the preterm born group >> clustered within families.
M:cognitive task; continuous
Y: IQ; continous
All variables are measured at the individual level. I am not interested in the family effect, I just want to take into account the clustering. Therefore I thought the 1-1-1 model is appropriate (is this correct?). I used the code by Preacher (2010):
...
BETWEEN ARE
Preterm;
CLUSTER IS Family;
MISSING ARE ALL (999);
ANALYSIS: TYPE IS TWOLEVEL RANDOM;
MODEL:
%WITHIN%
M IQ;
sb | IQ ON M;
%BETWEEN%
F1 BY Preterm@1; Preterm@0;
sb F1 M IQ;
M ON F1(a);
IQ ON M(bb);
IQ ON F1;
sb WITH F1 M IQ;
[sb](bw);
MODEL CONSTRAINT:
NEW(b indb);
b=bb+bw;
indb=a*b;
OUTPUT: TECH1 TECH8 CINTERVAL;

THE STANDARD ERRORS OF THE MODEL PARAMETER ESTIMATES COULD NOT BE COMPUTED. THIS IS OFTEN DUE TO THE STARTING VALUES BUT MAY ALSO BE AN INDICATION OF MODEL NONIDENTIFICATION. CHANGE YOUR MODEL AND/OR STARTING VALUES. PROBLEM INVOLVING THE FOLLOWING PARAMETER: Parameter 10, %BETWEEN%: SB

What exactly is the problem with sb?
 Tihomir Asparouhov posted on Monday, August 06, 2018 - 11:32 am
Because most of your clusters are of size 1, you should abandon the two-level model completely, which is not designed for such purpose. Use single level model with type = complex.
 Sabrina Twilhaar posted on Monday, August 06, 2018 - 1:21 pm
Thank you. A simulation study has been published on exactly this clustering issue in preterm infants where cluster size is usually small (https://onlinelibrary.wiley.com/doi/pdf/10.1002/sim.5638):

"in datasets with small clusters, mixed models should be the method of choice irrespective of the percentage of twins. If the mixed model does not converge, a linear regression can be fitted, but standard error will be underestimated, and so type I error may be inflated."

In my data set 25% is twin. I'd like to know whether the error likely results from non-convergence or if there is indeed something with this sb parameter that I could fix. The full error message:

THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO AN ILL-CONDITIONED FISHER INFORMATION MATRIX. CHANGE YOUR MODEL AND/OR STARTING VALUES.

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 CONDITION NUMBER IS 0.373D-10.

THE STANDARD ERRORS OF THE MODEL PARAMETER ESTIMATES COULD NOT BE COMPUTED. THIS IS OFTEN DUE TO THE STARTING VALUES BUT MAY ALSO BE AN INDICATION OF MODEL NONIDENTIFICATION. CHANGE YOUR MODEL AND/OR STARTING VALUES. PROBLEM INVOLVING THE FOLLOWING PARAMETER: Parameter 10, %BETWEEN%: SB
 Tihomir Asparouhov posted on Monday, August 06, 2018 - 4:21 pm
Here is some more feedback - not necessarily what you are asking for .... but ...

1) You have to read Section 6
http://www.statmodel.com/download/CenteredMediation.pdf
The only way you can meaningfully proceed with two-level model is to switch to Bayes or at least use the appropriate formula for the indirect effect.

2) You say that you want the indirect effect on the individual level but your indirect effect as written above is on the family level

3) You don't need F1 - you can use the indicator directly

4) I think your model is actually 2-1-1

5) I would have to look at your example to tell you more about the message - you can send data and output to support@statmodel.com
 Sabrina Twilhaar posted on Wednesday, August 08, 2018 - 5:26 am
Thank you, I really appreciate your feedback.
You are right, the model should be 2-1-1. As X does not vary within clusters (only M and Y do), I have no indirect effect on the within level, only at the between level. So I think what I wrote was wrong, but I hope that my code was correct in this respect.

As I understood it correctly, I should use the Bayes estimator and use indb=a*bb instead of indb=(bb+bw)*a. However, I think I should then upgrade to Mplus 8 to use the latent centering approach, right (I have Mplus 7.31)?

If I stick to the Hybrid method (in case I would not be able to use Mplus 8), I should use the formula as described in Appendix B from the paper you mentioned. I really tried to understand how to translate that to my code (indb=(bb+bw+?)*a) and I also had a look at the scripts that belong to the paper, but I don't fully understand how to calculate b1 and v1 in my case (to calculate b1/v1 that should come at question mark).
 Tihomir Asparouhov posted on Thursday, August 09, 2018 - 9:05 am
I would not really recommend using Appendix B because your model is not identical to that model and I would not assume that it will apply to your model. You would need to understand the causal framework and work out the correct formula on you own using the method in Appendix B. Using observed centering if you don't have access to 8.1 would be in principle the better alternative but with your size cluster this is not an option. So without V8.1 I would switch to type=complex.
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: