Structural Equation Model for Testing Mediation Effect

Structural Equation Model for Testing Mediation Effect
Tags:

2019-02-06
Abstract:
Table of Contents
1 The lavaan Example
2 TITLE Command
TITLE: Example 7 Health Behavior in School Children Mediation Analsys of Latent Variables with Continuous Data using MLR Bulliedied, Alcohol, and Depression;
3 DATA Command
DATA: FILE IS "../../../data/hbsc-subset2/hbsc-subset2.dat"; LISTWISE = ON;
4 VARIABLE Command
VARIABLE: NAMES ARE stud_id schl_id Gender Age Grade body1r body2 body3r body4 body5r phyhlth1 phyhlth2 phyhlth3 phyhlth4 phyhlth5 phyhlth6 phyhlth7 phyhlth8 Depress1 Depress2 Depress3 Depress4 Depress5 Depress6 Bullied1 Bullied2 Bullied3 Bullied4 Bullied5 Bullied6 Bullied7 Bullied8 Bullied9 Bullier1 Bullier2 Bullier3 Bullier4 Bullier5 Bullier6 Bullier7 Bullier8 Bullier9 Alc1 Alc2 Alc3 Alc4 Alc5; USEVARIABLES ARE Bullied1-Bullied9 Alc1-Alc5 Depress1-Depress6; MISSING ARE all(-999);
5 ANALYSIS Command
ANALYSIS: ESTIMATOR = ML; BOOTSTRAP = 10;
6 MODEL Command
MODEL: Bullied BY Bullied1* Bullied2-Bullied9; Bullied@1.0; Alcohol BY Alc1* Alc2-Alc5; Alcohol@1.0; Depress BY Depress1* Depress2-Depress6; Depress@1.0; Depress ON Bullied; Alcohol ON Bullied Depress; MODEL INDIRECT: Alcohol IND Depress Bullied;
7 OUTPUT Command
OUTPUT: SAMPSTAT; TECH1; STANDARDIZED; CINTERVAL;
8 Run the Model
mplus sem-02-mlboot-listwise.inp
Mplus VERSION 8.2 (Linux) MUTHEN & MUTHEN Running input file 'sem-02-mlboot-listwise.inp'... ESTIMATION WITH BOOTSTRAP DRAW NUMBER 1 ESTIMATION WITH BOOTSTRAP DRAW NUMBER 2 ESTIMATION WITH BOOTSTRAP DRAW NUMBER 3 ESTIMATION WITH BOOTSTRAP DRAW NUMBER 4 ESTIMATION WITH BOOTSTRAP DRAW NUMBER 5 ESTIMATION WITH BOOTSTRAP DRAW NUMBER 6 ESTIMATION WITH BOOTSTRAP DRAW NUMBER 7 ESTIMATION WITH BOOTSTRAP DRAW NUMBER 8 ESTIMATION WITH BOOTSTRAP DRAW NUMBER 9 ESTIMATION WITH BOOTSTRAP DRAW NUMBER 10 Beginning Time: 09:50:55 Ending Time: 09:50:56 Elapsed Time: 00:00:01 Output saved in 'sem-02-mlboot-listwise.out'.
9 Review the Results
Click sem-02-mlboot-listwise.out to see the output.