I am trying to test a simple mediation model where a level-2 predictor (w) is an exogenous variable and a level-1 variable (y1) is the primary endogenous variable. Variables x1 and x2 (both level-1 variables) are hypothesized to be mediators of this relationship.
When I run the code below I get the following WARNING:
** WARNING in MODEL command In the MODEL command, the following variable is a y-variable on the BETWEEN level and an x-variable on the WITHIN level. This variable will be treated as a y-variable on both levels: X1 *** WARNING in MODEL command In the MODEL command, the following variable is a y-variable on the BETWEEN level and an x-variable on the WITHIN level. This variable will be treated as a y-variable on both levels: X2
However, despite this WARNING I do get an estimate of both the y1-x1 and y1-x2 relationship at the WITHIN level according to the output.
Should I be worried, or is there a better way to specify this mediation model?
It is just saying the x1 and x2 are being treated at dependent variables on both levels. This means distributional assumptions are made about them. If this is the model you want, this is how it is done.
Hello, I am running a similar multilevel mediational path model [per Preacher et al (2011), a 2-1-1 model], yet with a 4-level categorical (ordinal) outcome (i.e. y1 above is ordinal). Mplus does not seem to allow this, with the message:
*** ERROR in MODEL command Observed variable on the right-hand side of a between-level ON statement must be a BETWEEN variable. Problem with: x1 Same message repeated for any mediating variables with both within and between level components.
Running with the outcome as continuous does work. Is there a different setup required, or is the multilevel ordinal logistic model with mediation impossible to test with Mplus? I realize the numerical integration makes it computationally problematic, but Mplus won't try to run it. Thanks, Phil
Thanks Dr. Muthen. The workaround of creating the perfect factors separating within/between components did work.
As a followup question, I wonder if Mplus is able to model a weighted TWOLEVEL model with an ordinal outcome and mediators using MLR, to obtain an ordinal logistic model.
The model runs using WLSMV but not with MLR, and I receive this error:
THE ESTIMATED WITHIN COVARIANCE MATRIX COULD NOT BE INVERTED. COMPUTATION COULD NOT BE COMPLETED IN ITERATION 1. 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.
The chapter 16 tables of estimators seems to indicate the MLR should work, but perhaps I've set this up incorrectly. I'd appreciate any suggestions you might have. The following post will show a simplified model that yields the error.
Thanks Dr. Muthen, adding back that little bit of variance allowed the model to work under MLR. I appreciate your prompt suggestions. Very best regards, Phil
Andy Luse posted on Wednesday, August 01, 2012 - 11:08 am
I have a 1-2-1 mediation model where the two within IVs (rotate, healthy) are dicotomous, the 2nd level mediator is latent-continuous (Imp), and the 1st level DV (choice) is also dichotomous. I am trying to test for indirect effects for each of the two IVs through the mediator. I tried using your suggestions above, but I get the same error when setting @0 and when I set it @0.01 it just keeps running.
Andy Luse posted on Wednesday, August 01, 2012 - 11:11 am
Here is the syntax...
USEVARIABLES ARE id choice rotate healthy Imp_1 Imp_2 Imp_3 Imp_4 Imp_5 Imp_7 Imp_9;
CLUSTER IS id;
BETWEEN ARE Imp_1 Imp_2 Imp_3 Imp_4 Imp_5 Imp_7 Imp_9;
Andy Luse posted on Friday, August 03, 2012 - 10:06 am
Ok, I have broken it down to where I am just trying to estimate the direct effect at each level with a single dichotomous IV (rotate) and a single dicotomous DV (choice), but I get the error "THE ESTIMATED WITHIN COVARIANCE MATRIX COULD NOT BE INVERTED. COMPUTATION COULD NOT BE COMPLETED IN ITERATION 1. CHANGE YOUR MODEL AND/OR STARTING VALUES." I'm trying to use the method above.
You should change within and between in the same way.
Andy Luse posted on Friday, August 03, 2012 - 2:26 pm
When I try that, I get the following error and it doesn't run "Unrestricted x-variables in TWOLEVEL analysis with ALGORITHM=INTEGRATION must be specified as either a WITHIN or BETWEEN variable. The following variable cannot exist on both levels: ROTATE"
With numerical integration, the latent variable decomposition of a individual variable is not allowed. You need to create a between-level variable for rotate. You can do this using the CLUSTER_MEAN option of the DEFINE command.
Andy Luse posted on Saturday, August 04, 2012 - 12:21 pm
Ok, I made a new cluster-level variable for rotate using the CLUSTER_MEAN command and then specified rotate as a within variable and the new variable (rotate_b) as a between variable. Now I am getting the following error...
*** ERROR One or more variables have a variance of zero. Check your data and format statement.
Continuous Number of Variable Observations Variance
I'm not sure why choice is listed as a continuous variable as I have specified it as categorical in the variable portion. It makes sense that rotate_b would have a variance of zero as it is the mean of the within subjects dichotomous experimental condition rotate.