I am new Mplus license user. I am doing a multilevel path analysis. Children from 100 schools are assessed on a number of variables. I have two continuous dependent variables, four IVs, and three covariates. I always get the following error message:
ERROR One or more between-level variables have variation within a cluster for one or more clusters. Check your data and format statement.
Here's the code that I used
VARIABLE: Names are Grade Age Sex Fruit_intake vegetables food_ad know_healthy school_goodcook school weight;
usevariables are Fruit_intake vegetables food_ad know_healthy school_goodcook; Within = food_ad know_healthy school_goodcook; Between = food_ad know_healthy school_goodcook;
Cluster is school; Weight is weight;
ANALYSIS: Type = Twolevel; Estimator is WLSM; Iterations = 10000; H1iterations = 10000;
Model: %BETWEEN% Fruit on food_ad know_healthy school_goodcook;
%WITHIN% Fruit on food_ad know_healthy school_goodcook;
The message is related to your data. Any variable on the BETWEEN list must have the same value for members of a cluster. Your data do not follow this rule. If you can't see the problem, send your output, data, and license number to email@example.com.
I am running a multilevel regression. My DV is continuous. I have a set of within level variables (exposure to media, etc.) and SES as the between level predictor (1= underprivileged, 2= privileged). I want to obtain the interaction effect of SES and my within level predictors. Is this the correct command (int | ses XWITH media).
Thanks a lot, Marie
%BETWEEN% sodaR on ses; sodaR with slope;
%WITHIN% SLOPE | sodaR on Foutlet; SodaR on eTV ePC;
int | ses XWITH Foutlet;
ANALYSIS: Type = Twolevel random; Estimator is MLR; Iterations = 10000; H1iterations = 10000;
The random slope model gives you the cross-level interaction. You would not use XWITH. See Slide 45 of the Topic 7 course handout on the website to see how this works. See also Example 9.2.
Byungbae Kim posted on Thursday, January 09, 2014 - 10:54 am
Hi. I am running a two level path model (2-1-1 model). I have two level-2 measures, two mediators and one outcome. This model is as follows;
%within% dv m1 m2; dv on m1 m2; m1 with m2;
%between% x1 x2; m1 on x1 x2; m2 on x1 x2; x1 with x2;
This model worked fine. Now I want to add individual level control variables (ie. age and gender) both to the within and between levels. Do you think the below codes are correct? My particular concern is whether I can specify level 1 variables, such as age and gender, at the between level. To clarify, my intention behind controlling for individual level covariates was to examine whether my level-2 variables (x1 and x2) are related to the mediators, net of age and gender of respondents.
%within% dv m1 m2; dv on m1 m2 age gender; m1 with m2;
%between% x1 x2; m1 on x1 x2 age gender; m2 on x1 x2 age gender; x1 with x2;