Mplus Syntax
quantpsy.org
© 2010-2017,
Kristopher J. Preacher

Mplus syntax to accompany models and analyses in:

Selig, J. P., & Preacher, K. J. (2009). Mediation models for longitudinal data in developmental research. Research in Human Development, 6, 144-164.

Mplus syntax for the latent difference score (LDS) model.

    TITLE: Selig & Preacher (2009)

    DATA: FILE IS MASTER.TXT;

    VARIABLE: NAMES ARE
    MDEP6A MDEP6B MDEP6C
    MDEP15A MDEP15B MDEP15C
    SENS15 INTRU15 POSREG15 
    SENS24 INTRU24 POSREG24
    T_ANXDP T_WITHD T_AGRES T_DESTR 
    T_ANXD36 T_WITH36 T_AGRE36 T_DEST36;

    MISSING IS .;

    MODEL:
    !LAMBDA
    MDEP1 BY MDEP6A@1
             MDEP6B(1)
             MDEP6C(2);
    MDEP2 BY MDEP15A@1 
              MDEP15B(1)
              MDEP15C(2);
    SENS2 BY SENS15*(3) 
             INTRU15(4)
             POSREG15@1;
    SENS3 BY SENS24*(3) 
             INTRU24(4)
             POSREG24@1;
    CBCL3 BY T_ANXDP@1 
              T_WITHD(5) 
              T_AGRES(6) 
              T_DESTR(7); 
    CBCL4 BY T_ANXD36@1 
              T_WITH36(5) 
              T_AGRE36(6) 
              T_DEST36(7);
    !THETA
    MDEP6A*; MDEP6B*; MDEP6C*;
    MDEP15A*; MDEP15B*; MDEP15C*;
    SENS15*; INTRU15*; POSREG15*; 
    SENS24*; INTRU24*; POSREG24*;
    T_ANXDP*; T_WITHD*; T_AGRES*; T_DESTR*; 
    T_ANXD36*; T_WITH36*; T_AGRE36*; T_DEST36*;
    MDEP6A WITH MDEP15A*; MDEP6B WITH MDEP15B*; MDEP6C WITH MDEP15C*;
    SENS15 WITH SENS24*; INTRU15 WITH INTRU24*; POSREG15 WITH POSREG24*;
    T_ANXDP WITH T_ANXD36*; T_WITHD WITH T_WITH36*;
    T_AGRES WITH T_AGRE36*; T_DESTR WITH T_DEST36*;
    POSREG24 WITH SENS24*;

    !BETA
    MDEP2 ON MDEP1 @1;
    MDIFF BY MDEP2 @1;
    MDIFF ON MDEP1*;
    !PSI
    MDEP1*; MDEP2@0; MDIFF*;
    !BETA
    SENS3 ON SENS2 @1;
    SDIFF BY SENS3 @1;
    SDIFF ON SENS2*;
    !PSI
    SENS2*; SENS3@0; SDIFF*;
    !BETA
    CBCL4 ON CBCL3 @1;
    CDIFF BY CBCL4 @1;
    CDIFF ON CBCL3*;
    !PSI
    CBCL3*; CBCL4@0; CDIFF*;
    !BETA
    SENS2 ON MDEP1 MDIFF;
    SDIFF ON MDEP1 MDIFF;
    CBCL3 ON MDEP1 MDIFF SENS2 SDIFF;
    CDIFF ON MDEP1 MDIFF SENS2 SDIFF;

    MODEL INDIRECT:
    !From MDIFF->SENS2->CBCL3;
    CBCL3 IND SENS2 MDIFF;
    !From MDEP1->SDIFF->CDIFF;
    CDIFF IND SDIFF MDEP1;
    !From MDEP1->SENS2->CBCL3;
    CBCL3 IND SENS2 MDEP1;
    !From MDEP1->SDIFF->CBCL3;
    CBCL3 IND SDIFF MDEP1;