The CAUSALMED Procedure

Example 38.1 Mediation Analysis with Interaction Effects and Four-Way Decomposition

(View the complete code for this example.)

This example continues the example in the section Getting Started: CAUSALMED Procedure by including an interaction effect between the treatment and the mediator in the outcome model. It also shows how you can obtain a four-way decomposition of the effects.

The goals of the observational study on are to determine whether an encouraging environment provided by parents (which is represented by the variable Encourage) has an effect on the cognitive development of children (which is represented by the variable CogPerform) and to estimate the amount of the total causal effect that is due to the mediation of learning motivation (which is represented by the variable Motivation).

In the example on , the following statements are used to request a mediation analysis in which the main effects of Encourage and Motivation are specified in the outcome model:

proc causalmed data=Cognitive;
   model    CogPerform  = Encourage Motivation;
   mediator Motivation  = Encourage;
   covar FamSize SocStatus;
run;

This analysis also specifies confounding covariates, and it produces the summary of effects in Output 38.1.1.

Output 38.1.1: Estimation of Causal Effects Adjusting for Confounding Covariates

Summary of Effects
  Estimate Standard
Error
Wald 95%
Confidence Limits
Z Pr > |Z|
Total Effect 6.8435 0.1525 6.5446 7.1424 44.88 <.0001
Controlled Direct Effect (CDE) 4.2962 0.1098 4.0811 4.5114 39.14 <.0001
Natural Direct Effect (NDE) 4.2962 0.1098 4.0811 4.5114 39.14 <.0001
Natural Indirect Effect (NIE) 2.5473 0.1563 2.2410 2.8536 16.30 <.0001
Percentage Mediated 37.2219 1.7523 33.7874 40.6564 21.24 <.0001
Percentage Due to Interaction 0 . . . . .
Percentage Eliminated 37.2219 1.7523 33.7874 40.6564 21.24 <.0001


The following statements extend the analysis by including an interaction term between Encourage and Motivation in the outcome model:

proc causalmed data=Cognitive decomp;
   model    CogPerform  = Encourage | Motivation;
   mediator Motivation  = Encourage;
   covar    FamSize SocStatus;
run;

The specification Encourage | Motivation includes the main effects of Encourage and Motivation and their interaction. Equivalently, you could specify Encourage Motivation Encourage*Motivation, where the third term represents the interaction effect. The results of this analysis are shown in Output 38.1.2.

Output 38.1.2: Summary of Causal Effects with Interaction Effects

Summary of Effects
  Estimate Standard
Error
Wald 95%
Confidence Limits
Z Pr > |Z|
Total Effect 6.8421 0.1430 6.5618 7.1224 47.84 <.0001
Controlled Direct Effect (CDE) 4.1797 0.04696 4.0876 4.2717 89.00 <.0001
Natural Direct Effect (NDE) 4.1509 0.04706 4.0587 4.2432 88.21 <.0001
Natural Indirect Effect (NIE) 2.6912 0.1453 2.4065 2.9759 18.53 <.0001
Percentage Mediated 39.3325 1.3704 36.6465 42.0184 28.70 <.0001
Percentage Due to Interaction 0.4197 0.02367 0.3733 0.4661 17.73 <.0001
Percentage Eliminated 38.9128 1.3574 36.2524 41.5733 28.67 <.0001


When the interaction term is included, the 'Percentage Mediated' changes slightly from 37% (for the model without this term) to 39%. Although the percentage due to interaction that is shown in Output 38.1.2 is significant, it is less than 1%. Therefore, the interpretation of the results is not drastically different from those of the analysis with no interaction.

When you specify the DECOMP option, the CAUSALMED procedure generates a table, shown in Output 38.1.3, that displays various decompositions of the total effect: several two-way and three-way decompositions and a four-way decomposition. For more information about various decompositions and their interpretations, see the section Causal Mediation Effects: Theory, Definitions, and Effect Decompositions.

Output 38.1.3: Decompositions of the Total Effect

Decompositions of Total Effect
Decomposition Effect Estimate Standard
Error
Wald 95%
Confidence Limits
Z Pr > |Z|
NDE+NIE Natural Direct 4.1509 0.04706 4.0587 4.2432 88.21 <.0001
  Natural Indirect 2.6912 0.1453 2.4065 2.9759 18.53 <.0001
CDE+PE Controlled Direct 4.1797 0.04696 4.0876 4.2717 89.00 <.0001
  Portion Eliminated 2.6625 0.1438 2.3807 2.9443 18.52 <.0001
TDE+PIE Total Direct 4.2084 0.04695 4.1163 4.3004 89.63 <.0001
  Pure Indirect 2.6338 0.1423 2.3548 2.9127 18.51 <.0001
NDE+PIE+IMD Natural Direct 4.1509 0.04706 4.0587 4.2432 88.21 <.0001
  Pure Indirect 2.6338 0.1423 2.3548 2.9127 18.51 <.0001
  Mediated Interaction 0.05743 0.003391 0.05078 0.06407 16.93 <.0001
CDE+PIE+PAI Controlled Direct 4.1797 0.04696 4.0876 4.2717 89.00 <.0001
  Pure Indirect 2.6338 0.1423 2.3548 2.9127 18.51 <.0001
  Portion Due to Interaction 0.02871 0.002009 0.02478 0.03265 14.30 <.0001
Four-Way Controlled Direct 4.1797 0.04696 4.0876 4.2717 89.00 <.0001
  Reference Interaction -0.02871 0.002009 -0.03265 -0.02478 -14.30 <.0001
  Mediated Interaction 0.05743 0.003391 0.05078 0.06407 16.93 <.0001
  Pure Indirect 2.6338 0.1423 2.3548 2.9127 18.51 <.0001
Total Total Effect 6.8421 0.1430 6.5618 7.1224 47.84 <.0001
Note: NDE=CDE+IRF, NIE=PIE+IMD, PAI=IRF+IMD, PE=PAI+PIE, TDE=CDE+PAI.


Important effects such as CDE, NDE, and NIE that contribute to the components of the decompositions are shown in the "Summary of Effects" table in Output 38.1.2.

The primary decomposition in the table in Output 38.1.3 is the four-way decomposition. All other component effects can be deduced by summing up particular subsets of the effects in the four-way decomposition. The note at the bottom of the table shows how component effects are related.

The DECOMP option also generates a table of percentage decompositions, which is shown in Output 38.1.4.

Output 38.1.4: Percentage Decompositions of the Total Effect

Percentage Decompositions of Total Effect
Decomposition Effect Percent Standard
Error
Wald 95%
Confidence Limits
Z Pr > |Z|
NDE+NIE Natural Direct 60.67 1.37 57.98 63.35 44.27 <.0001
  Natural Indirect 39.33 1.37 36.65 42.02 28.70 <.0001
CDE+PE Controlled Direct 61.09 1.36 58.43 63.75 45.00 <.0001
  Portion Eliminated 38.91 1.36 36.25 41.57 28.67 <.0001
TDE+PIE Total Direct 61.51 1.34 58.87 64.14 45.75 <.0001
  Pure Indirect 38.49 1.34 35.86 41.13 28.63 <.0001
NDE+PIE+IMD Natural Direct 60.67 1.37 57.98 63.35 44.27 <.0001
  Pure Indirect 38.49 1.34 35.86 41.13 28.63 <.0001
  Mediated Interaction 0.84 0.04 0.77 0.91 23.65 <.0001
CDE+PIE+PAI Controlled Direct 61.09 1.36 58.43 63.75 45.00 <.0001
  Pure Indirect 38.49 1.34 35.86 41.13 28.63 <.0001
  Portion Due to Interaction 0.42 0.02 0.37 0.47 17.73 <.0001
Four-Way Controlled Direct 61.09 1.36 58.43 63.75 45.00 <.0001
  Reference Interaction -0.42 0.02 -0.47 -0.37 -17.66 <.0001
  Mediated Interaction 0.84 0.04 0.77 0.91 23.65 <.0001
  Pure Indirect 38.49 1.34 35.86 41.13 28.63 <.0001
Note: NDE=CDE+IRF, NIE=PIE+IMD, PAI=IRF+IMD, PE=PAI+PIE, TDE=CDE+PAI.


This table shows that the two components that involve the interaction make up a very small percentage of the total effect. The mediated interaction effect represents less than 1%, and the reference interaction is very small and negative.

Last updated: December 09, 2022