Fitting a Dynamic Measurement Burst Model in Mplus

On this page, we present the Mplus model syntax used to specify the DMBM, as introduced in Andresen et. al. (in prep). This syntax corresponds with models 2a and 2b, as presented in section 3.3.2 of the paper.

Specifying the DMBM in four Steps

We can specify the DMBM in four steps.

  1. Specify the within part, where we specify the micro-level model for each burst separately. Per burst, we specify autoregressive parameters A1, A2, A3,...; A_Burst. Optionally, we can additionally specify the random residual variances (C1, C2, C3...;) per burst, which can then be further modeled as the log residual variance (i.e., the compound of reactivity and exposure to shocks) at the %BETWEEN% level.

  2. Specify the between part, where the random intercepts are specified. It is specified using the BY command, RI_Y BY Y1@1 Y2@1 Y#@1...;, where @1 fixes the factor loading to one. This process is repeated for every process feature modeled at the meso- and macro-level. Furthermore, for each feature at each burst, we define the burst- and person-specific deviations from the person’s random intercept (i.e., the within-person components WC). For example, for the mean at burst 1, we write: WCY1 BY Y1; Y1@0.001; which defines the within-person component for the mean and fixes the prior for residual variance of the observed mean Y1 to (almost) zero.

  3. Specify the meso-level dynamics between burst- and person-specific deviations from the person’s random intercept of that feature at each burst, using WCY2 WCY3 ON WCY1 WCY2; ..., to define autoregressive effects, and WCY2 WCY3 ON WCA1 WCA2;... to define cross-lagged effects, in this example of the mean regressed on WCA1.

  4. Specify relevant covariances and residual covariances at the meso-level. Here, we constrain residual covariances to be equal at all bursts (e.g., WCY2 WITH WCC2 (rc1); WCY3 WITH WCC3 (rc1);) to simplify the model.

Below, we present syntax for each of these steps, for models 2a (excl. random residual variances) and 2b (incl. random residual variances) presented in the paper. Please note that Mplus defaults vary in some places between the two models.

Step 1: Specifying the WITHIN Level

The syntax for specifying the WITHIN part of the DMBM excluding random residual variances (i.e., model 2a) is given below.

! ---------------------------------------------------------
! GENERAL MODEL SET-UP
! ---------------------------------------------------------

TITLE:    Mode2a DMBM;
DATA:     FILE = "Example.dat";

VARIABLE: NAMES = ID hour Y1 Y2 Y3;
          MISSING=.;

          CLUSTER = ID;
          USEVAR = Y1 Y2 Y3 ;

          LAGGED = Y1(1) Y2(1) Y3(1);

          TINTECAL = hour(1);
          MISSING = ALL(999);

ANALYSIS:
          TYPE = TWOLEVEL RANDOM;
          ESTIMATOR = BAYES;
          FBITERATIONS = (50000);
          THIN = 10;
          CHAINS=2;
          PROCESSORS = 40;

! ---------------------------------------------------------
! MODEL DEFINITION
! ---------------------------------------------------------
MODEL:

%WITHIN%
     
! PER BURST: SPECIFY AR(1) PROCESS WITH A RANDOM AUTOREGRESSION

          A1 | Y1 ON Y1&1;
          A2 | Y2 ON Y2&1;
          A3 | Y3 ON Y3&1;

! SET COVARIANCES BETWEEN BURST-SPECIFIC OBSECATIONS TO ZERO (NOT DEFAULT)
          Y1 Y2 WITH Y3@0;
          Y1 WITH Y2@0;

The syntax for specifying the WITHIN part of the DMBM including random residual variances (i.e., model 2b) is given below.

! ---------------------------------------------------------
! GENERAL MODEL SET-UP
! ---------------------------------------------------------

TITLE:    Mode2b DMBM;
DATA:     FILE = "Example.dat";

VARIABLE: NAMES = ID hour Y1 Y2 Y3;
          MISSING=.;

          CLUSTER = ID;
          USEVAR = Y1 Y2 Y3 ;

          LAGGED = Y1(1) Y2(1) Y3(1);

          TINTECAL = hour(1);
          MISSING = ALL(999);

ANALYSIS:
          TYPE = TWOLEVEL RANDOM;
          ESTIMATOR = BAYES;
          FBITERATIONS = (50000);
          THIN = 10;
          CHAINS=2;
          PROCESSORS = 40;

! ---------------------------------------------------------
! MODEL DEFINITION
! ---------------------------------------------------------

MODEL:

%WITHIN%
     
! PER BURST: SPECIFY AR(1) PROCESS WITH A RANDOM AUTOREGRESSION

          A1 | Y1 ON Y1&1;
          A2 | Y2 ON Y2&1;
          A3 | Y3 ON Y3&1;
          
! PER BURST: SPECIFY RANDOM RESIDUAL VARIANCES (WILL BE LOG RESIDUAL VARIANCES AT BETWEEN LEVEL
          C1 | Y1;
          C2 | Y2;
          C3 | Y3;

Step 2: Specify the BETWEEN part of the DBMB

The syntax for specifying the first part of the BETWEEN level of the DMBM excluding random residual variances (i.e., model 2a) is given below. Here, we define random intercepts per process feature, and subsequently define per burst within-person components for each feature.

%BETWEEN%

! ---------------------------------------------------------
! CREATE RANDOM INTERCEPTS FOR PROCESS FEATURES
! Y   = macro-level mean (M_i)
! A   = macro-level autoregression / inertia (A_i)
! Y1–Y3 = burst-specific means (M1–M3)
! A1–A3 = burst-specific autoregressive effects
! ---------------------------------------------------------

            Y BY Y1-Y3@1;     ! RI for mean (M_i)
            A BY A1-A3@1;     ! RI for autoregression (A_i)


! ---------------------------------------------------------
! MACRO-LEVEL COVARIANCE BETWEEN PROCESS FEATURES
! ---------------------------------------------------------

            Y WITH A;         ! covariance between M_i and A_i


! ---------------------------------------------------------
! CREATE WITHIN-PERSON BURST-SPECIFIC COMPONENTS (WC)
! These represent deviations from the person's RI
! ---------------------------------------------------------

            ! WITHIN-PERSON COMPONENTS FOR MEANS (M)
            WCY1 BY Y1; Y1@0.001;
            WCY2 BY Y2; Y2@0.001;
            WCY3 BY Y3; Y3@0.001;

            ! WITHIN-PERSON COMPONENTS FOR AUTOREGRESSIONS (A)
            WCA1 BY A1; A1@0.001;
            WCA2 BY A2; A2@0.001;
            WCA3 BY A3; A3@0.001;


! ---------------------------------------------------------
! SET COVARIANCES BETWEEN WC COMPONENTS AND RIs TO ZERO
! ---------------------------------------------------------

            WCY1 WITH Y@0;
            WCY1 WITH A@0;

            WCA1 WITH A@0;
            WCA1 WITH Y@0;

The syntax for specifying the first part of the BETWEEN level of the DMBM including random residual variances (i.e., model 2b) is given below. Here, we define random intercepts per process feature, and subsequently define per burst within-person components for each feature.

%BETWEEN%

! ---------------------------------------------------------
! CREATE RANDOM INTERCEPTS FOR PROCESS FEATURES
! Y = macro-level mean (M_i)
! A = macro-level autoregression / inertia (A_i)
! C = macro-level compound / innovation variance (C_i)
!
! Y1–Y3 = burst-specific means (M1–M3)
! A1–A3 = burst-specific autoregressive effects
! C1–C3 = burst-specific compound variances
! ---------------------------------------------------------

            Y BY Y1-Y3@1;     ! RI for mean (M)
            A BY A1-A3@1;     ! RI for autoregression (A)
            C BY C1-C3@1;     ! RI for compound variance (C)


! ---------------------------------------------------------
! MACRO-LEVEL COVARIANCES BETWEEN PROCESS FEATURES
! ---------------------------------------------------------

            Y WITH A C;
            A WITH C;


! ---------------------------------------------------------
! CREATE WITHIN-PERSON BURST-SPECIFIC COMPONENTS (WC)
! Deviations from the person's random intercept
! ---------------------------------------------------------

            ! WITHIN-PERSON COMPONENTS FOR MEANS (M)
            WCY1 BY Y1; Y1@0.001;
            WCY2 BY Y2; Y2@0.001;
            WCY3 BY Y3; Y3@0.001;

            ! WITHIN-PERSON COMPONENTS FOR AUTOREGRESSIONS (A)
            WCA1 BY A1; A1@0.001;
            WCA2 BY A2; A2@0.001;
            WCA3 BY A3; A3@0.001;

            ! WITHIN-PERSON COMPONENTS FOR COMPOUND VARIANCE (C)
            WCC1 BY C1; C1@0.001;
            WCC2 BY C2; C2@0.001;
            WCC3 BY C3; C3@0.001;


! ---------------------------------------------------------
! SET COVARIANCE OF WC COMPONENTS WITH RIs TO ZERO
! ---------------------------------------------------------

            WCY1 WITH Y@0;
            WCY1 WITH A@0;
            WCY1 WITH C@0;

            WCA1 WITH A@0;
            WCA1 WITH Y@0;
            WCA1 WITH C@0;

            WCC1 WITH A@0;
            WCC1 WITH Y@0;
            WCC1 WITH C@0;

Step 3: Specifying the Meso-level dynamics

The syntax for specifying the meso-level dynamics as part of the BETWEEN level of the DMBM excluding random residual variances (i.e., model 2a) is given below.

Here, we use the PON (” pairwise on”) statement to define autoregressive (AR) and cross-lagged (CL) effects.

! SPECIFY THE AUTOREGRESSIONS FOR THE WCs AND CONSTRAIN THESE TO BE INVARIANT OVER TIME

            ! AR EFFECT FOR MEANS
            WCY2 WCY3 PON WCY1 WCY2 (a1);

            ! AR EFFECT FOR INERTIAS
            WCA2 WCA3 PON WCA1 WCA2 (a2);


! SPECIFY THE CROSS-LAGGED EFFECTS OF WCs AND CONSTRAIN THESE TO BE INVARIANT OVER TIME

            ! CL EFFECT OF INERTIA ON MEAN
            WCY2 WCY3 PON WCA1 WCA2 (b1);

            ! CL EFFECT OF MEAN ON INERTIA
            WCA2 WCA3 PON WCY1 WCY2 (b2);

The syntax for specifying the meso-level dynamics as part of the BETWEEN level of the DMBM including random residual variances (i.e., model 2b) is given below.

Here, we use the PON (” pairwise on”) statement to define autoregressive (AR) and cross-lagged (CL) effects.

! SPECIFY THE AUTOREGRESSIONS FOR THE WCs AND CONSTRAIN THESE TO BE INVARIANT OVER TIME

            ! AR EFFECT FOR MEANS
            WCY2 WCY3 PON WCY1 WCY2 (a1);

            ! AR EFFECT FOR INERTIAS
            WCA2 WCA3 PON WCA1 WCA2 (a2);

            ! AR EFFECT FOR RESIDUAL VARIANCE
            WCC2 WCC3 PON WCC1 WCC2 (a3);

! SPECIFY THE CROSS-LAGGED EFFECTS OF WCs AND CONSTRAIN THESE TO BE INVARIANT OVER TIME

            ! CL EFFECT OF INERTIAS ON THE MEANS
            WCY2 WCY3 PON WCA1 WCA2 (b1);
            
            ! CL EFFECT OF C ON THE MEANS
            WCY2 WCY3 PON WCC1 WCC2 (b2);

            ! CL EFFECT OF MEANS ON THE INERTIAS
            WCA2 WCA3 PON WCY1 WCY2 (b3);
            
            ! CL EFFECT OF C ON THE INERTIAS
            WCA2 WCA3 PON WCC1 WCC2 (b4);

            ! CL EFFECT OF MEANS ON THE C
            WCC2 WCC3 PON WCY1 WCY2 (b5);
            
            ! CL EFFECT OF INERTIAS ON THE C
            WCC2 WCC3 PON WCA1 WCA2 (b6);

Step 4: Specifying (residual) covariances of the DMBM

The syntax for specifying the meso-level (residual) covariances as part of the BETWEEN level of the DMBM excluding random residual variances (i.e., model 2a) is given below.

Here, we use labeling to put constraints on the residual covariances ((rc1)) and the residual variances ((rv1)). Specifically, we constrain residual covariances to be time invariant, that is, equal at bursts 2 and 3 (e.g., WCY2 WITH WCA2 (rc1); WCY3 WITH WCA3 (rc1);), a setting which in Mplus v8.11 additionally requires to constrain the residual variances of each feature to be time invariant (e.g., WCY2 WCY3 (rv1);).

! ESTIMATING COVARIANCE OF THE WITHIN-COMPONENTS AT THE FIRST BURST

            WCY1 WITH WCA1;
            
! ESTIMATE COVARIANCES OF THE RESIDUALS OF THE WITHIN COMPONENTS AT 2ND AND 3RD BURST
! CONSTRAIN THESE TO BE INVARIANT OVER WAVES

            WCY2 WITH WCA2 (rc1);
              WCY3 WITH WCA3 (rc1);


! CONSTRAIN RESIDUAL VARIANCES OF THE WCs TO BE INVARIANT OVER BURSTS

            WCY2 WCY3 (rv1);
            WCA2 WCA3 (rv2);


            
! ---------------------------------------------------------
! DEFINE OUTPUT
! ---------------------------------------------------------

OUTPUT:
            TECH1 TECH8 STDYX FSCOMPARISON;
PLOT:
            TYPE = PLOT3;
            FACTOR =ALL;  

OUTPUT:
            TECH1 TECH8 STDYX FSCOMPARISON;
PLOT:
            TYPE = PLOT3;
            FACTOR =ALL;

The syntax for specifying the meso-level (residual) covariances as part of the BETWEEN level of the DMBM including random residual variances (i.e., model 2b) is given below.

Here, we use labeling to put constraints on the residual covariances ((rc1)) and the residual variances ((rv1)). Specifically, we constrain residual covariances to be time invariant, that is, equal at bursts 2 and 3 (e.g., WCY2 WITH WCA2 (rc1); WCY3 WITH WCA3 (rc1);), a setting which in Mplus v8.11 additionally requires to constrain the residual variances of each feature to be time invariant (e.g., WCY2 WCY3 (rv1);).

! ESTIMATE COVARIANCES OF THE WITHIN COMPONENTS AT THE FIRST BURST

            WCY1 WITH WCC1;
            WCY1 WITH WCA1;
            WCA1 WITH WCC1;
            
! ESTIMATE COVARIANCES OF THE RESIDUALS OF THE WITHIN COMPONENTS AT 2ND AND 3RD WA
! CONSTRAIN THESE TO BE INVARIANT OVER WAVES

            WCY2 WITH WCC2 (rc1);
            WCY3 WITH WCC3 (rc1);

            WCY2 WITH WCA2 (rc2);
            WCY3 WITH WCA3 (rc2);

            WCA2 WITH WCC2 (rc3);
            WCA3 WITH WCC3 (rc3);

! CONSTRAIN RESIDUAL VARIANCES OF THE WCs TO BE INVARIANT OVER WAVES
            WCY2 WCY3 (rv1);
            WCA2 WCA3 (rv2);
            WCC2 WCC3 (rv3);



! ---------------------------------------------------------
! DEFINE OUTPUT
! ---------------------------------------------------------

OUTPUT:
            TECH1 TECH8 STDYX FSCOMPARISON;
PLOT:
            TYPE = PLOT3;
            FACTOR =ALL;