!Mplus VERSION 8.6 - Jonathon Little !Metcalf, O., Little, J., Cowlishaw, S., Varker, T., Arjmand, H. A., O’Donnell, M. L., . . . Forbes, D. (2021). !Modelling the relationship between poor sleep and problem anger in veterans: A dynamic !structural equation modelling approach. Journal of Psychosomatic Research, 150, 110615. doi: 10.1016/j.jpsychores.2021.110615 TITLE: DSEM two-level model for anger and sleep DATA: file is 'C:\Temp\EMA.dat'; VARIABLE: NAMES = id v1_1 v2_1 v2_2 v2_3 v2_4; CLUSTER = id; USEVAR = v1_1 !Previous nights sleep v2_1 v2_2 v2_3 v2_4; !Anger observations from 10am - 7pm !Take care to observe timing of measurements when interpreting lags LAGGED = v1_1(1); MISSING = ALL (9999); ANALYSIS: TYPE IS TWOLEVEL RANDOM; ESTIMATOR = BAYES; FBITERATIONS = (100000); BSEED = 5699; MODEL: %WITHIN% A_Int BY v2_1 v2_2 v2_3 v2_4 (&1); !v2_1 fixed at 1 by default S1 | v1_1 ON v1_1&1; ! Random slope for v1 regressed on v2-1 (autoregression - interia slope) S2 | v1_1 ON A_Int&1; ! Random slope for v1 regressed on A_Int-1 (cross-lagged) S3 | A_Int ON v1_1; ! Random slope for A_Int regressed on v1 (cross-lagged) S4 | A_Int ON A_Int&1; ! Random slope for A_Int regressed on A_Int (autoregression - inertia slope) v2_2 v2_3 v2_4 pon v2_1 v2_2 v2_3 (1); v1_1 WITH A_Int; %BETWEEN% A_Intb BY v2_1@1 v2_2 v2_3 v2_4*; A_Intb* (In1); v1_1* (In2); v2_2 v2_3 v2_4 pon v2_1 v2_2 v2_3 (2); s1 (I1); s2 (CL1); s3 (I2); s4 (CL2); v1_1 S1-S4 A_Intb WITH v1_1 S1-S4 A_Intb; ! Correlations between all 6 random effects V2_1 WITH S1 (a); V2_1 WITH S2 (b); V2_1 WITH S3 (c); V2_1 WITH S4 (d); V2_1 WITH A_INTB (e); S1 WITH S2 (f); S1 WITH S3 (g); S1 WITH S4 (h); S1 WITH A_INTB (i); S2 WITH S3 (j); S2 WITH S4 (k); S2 WITH A_INTB (l); S3 WITH S4 (m); S4 WITH A_INTB (n); MODEL PRIORS: !Intercept variance priors In1 ~ IG(2.00, 0.30); In2 ~ IG(8.25, 0.928); !Insertia slope priors; I1 ~ IG(1.0, 0.01); !for inertia slope of <.90. Cant exceed a magnitude of 1 in either direction I2 ~ IG(1.0, 0.01); !for inertia slope of <.90. Cant exceed a magnitude of 1 in either direction !Cross-lagged slope priors CL1 ~ IG(14.0, 1.5); CL2 ~ IG(5.0, 0.6); !Random covariance effect seperation priors Model constraint: a < sqrt(In2)*sqrt(I1); b < sqrt(In2)*sqrt(CL1); c < sqrt(In2)*sqrt(I2); d < sqrt(In2)*sqrt(CL2); e < sqrt(In2)*sqrt(In1); f < sqrt(I1)*sqrt(CL1); g < sqrt(I1)*sqrt(I2); h < sqrt(I1)*sqrt(CL2); i < sqrt(I1)*sqrt(In1); j < sqrt(I2)*sqrt(I2); k < sqrt(I2)*sqrt(CL2); l < sqrt(I2)*sqrt(In1); m < sqrt(I2)*sqrt(CL2); n < sqrt(CL2)*sqrt(In1); OUTPUT: TECH1 TECH8 FSCOMPARISON STDYX TECH4 RESIDUAL CINTERVAL (EQTAIL); PLOT: TYPE = PLOT3; FACTOR =ALL;