-Code: DATA: FILE IS ...; listwise=on; VARIABLE: NAMES ARE pcid pcTRT ptid ptwaira2 ptkasra2 nucwai nucsdm; USEVARIABLES ARE pcTRT nucwai nucsdm; BETWEEN IS pcTRT; CLUSTER IS pcid; MISSING ARE ALL (-9999); ANALYSIS: TYPE IS TWOLEVEL RANDOM;
MODEL: %WITHIN% nucwai*72 nucsdm*124; sb | nucsdm ON nucwai;
%BETWEEN% pcTRT*.3 nucwai*26.0 nucsdm*52.0; nucwai ON pcTRT(a); nucsdm ON nucwai(bb); nucsdm ON pcTRT; [sb](bw); sb WITH pcTRT nucwai nucsdm;
-Problem: Without listwise deletion, I get: *** FATAL ERROR THIS MODEL CAN BE DONE ONLY WITH MONTECARLO INTEGRATION.. -After adding ALGORITHM = INT; Integration=MONTECARLO; to ANALYSIS section: *** ERROR in MODEL command Observed variable on the right-hand side of a between-level ON statement must be a BETWEEN variable. Problem with: NUCWAI *** ERROR The following MODEL statements are ignored: * Statements in the BETWEEN level: NUCSDM ON NUCWAI
If you have missing data on nucwai the model includes the product of two latent variables and there is no explicit likelihood expression - therefore you have to use numerical integration and a completely different algorithm, i.e., the missing data makes the algorithm quite a bit more complicated.
You can resolve your problem by using this equivalent model
%BETWEEN% pcTRT*.3 nucwai*26.0 nucsdm*52.0; nucwai ON pcTRT(a); nucsdm ON f(bb); nucsdm ON pcTRT; [sb](bw); sb WITH pcTRT nucwai nucsdm; f by nucwai@1; nucwai@0; f*1;
You should also consider using multiple imputation as an alternative estimation approach, that way you avoid numerical integration.
1 - I am trying to calculate a 2-1-1 multilevel mediation model where the mediator is binary. Will this input do this correctly and also calculate the indirect effect correctly? Conscie is the predictor x, poscons the mediator m, and success the outcome y.
… USEVARIABLES = poscons success conscie ID ; missing = poscons (-9) success (-9) conscie (-9) ID (-9) ; BETWEEN IS conscie ; CLUSTER IS ID; ANALYSIS: TYPE IS TWOLEVEL; ESTIMATOR = WLSMV; MODEL: %WITHIN% poscons success; success ON poscons(b); %BETWEEN% conscie poscons success; poscons ON conscie(a); success ON poscons(b); success ON conscie; MODEL CONSTRAINT: NEW(indb); indb=a*b; OUTPUT: TECH1 TECH8 CINTERVAL;
2 - I am using the WLMSV estimator. Is this correct? Or should I use ML or MLR?
3 - If I use WLMSV, how do I interpret the regression coefficients: Are they probit regression coefficients? Or can they be interpreted like regression coefficients from a linear regression?
I am trying to do something similar to the above. However, my X is measured at L2: middle managers (MMs) who are rating their superiors. Several MMs are rating the same superior. I also have covariates at each level. I have written the following syntax, but it will not run.
We need to see your full output - send to Support along with your license number.
Derek Boy posted on Wednesday, January 10, 2018 - 12:07 pm
Dear Dr. Muthen
I am considering a multilevel mediation analysis (while still pending the field data), with outcome EIP to be modeled at all three levels, mediator EEO also to be modeled at all three levels, and predictors EEL SGL CCT modeled at L1, L2, and L3 respectively. The codes that I wrote are as below. Would you please kindly let me know if I am doing it right or not? And, I am particularly nervous on my calculation of the indirect effect. Many many thanks.
WITHIN = EEL; BETWEEN = (S_ID) SGL (C_CN) CCT; CLUSTER = C_CN S_ID; ANALYSIS: TYPE = threelevel; MODEL: %WITHIN% EIP ON EEO (b1) EEL (c); EEO ON EEL (a); %BETWEEN S_ID% EIP ON SGL EEO (b2); EEO ON SGL; EEO; EIP; %BETWEEN C_CN% EIP ON EEO (b3); EEO ON CCT; EEO; MODEL CONSTRAINT: new(direct indirect); indirect = ((a*b1)+(a*b1*b2)+(a*b1*b2*b3)); direct = c; OUTPUT: sampstat tech1 tech8 cinterval;