Parametric Regression-Based Causal Mediation Analysis of Binary Outcomes and Binary Mediators: Moving Beyond the Rareness or Commonness of the Outcome
Mariia Samoilenko and Geneviève Lefebvre
Table of contents
Web Appendix 1 page 1
Web Appendix 2 page 15
Web Appendix 3 page 19
Web Table 1 page 39
Web Table 2 page 40
Web Table 3 page 42
Web Table 4 page 44
Web Table 5 page 46
Web Table 6 page 47
Web References page 48
WEB APPENDIX 1
General formulas used in the delta method for the exact regression-based mediation effects The formulas for calculating the confidence intervals of the natural effects on the odd ratio, risk ratio, and risk difference scales depend upon the nested counterfactual outcome probability
P
(
Y(a , M(a¿))=1|
C=c)
and its gradient with respect to the coefficients of the mediator and outcome models (β , θ) . The following equations will be used to derive the expression for the aforementioned gradient as well as those for the standard errors of estimates.For any scalar function φ(α) differentiable in Rn, where α=(α1, α2, … , αn)' , the partial derivatives of expit(φ(α)) and 1−expit(φ(α)) are:
∂
∂ αi
(
1exp+exp(φ(α(φ())α)))
=(1+expexp(φ((φα(α)))))2∙∂ φ(α)
∂ αi ,
∂
∂ αi
(
1+exp1(φ(α)))
=(1+exp−exp((φφ((αα)))))2∙∂ φ(α)
∂ αi ,
(A1)
where i=1, 2,… , n .
For any scalar functions f(α) and g(α) , differentiable in Rn and taking values in (0, 1) :
∂
∂ αi
(
ln(
1−f(fα(α) )) )
=∂ α∂i(ln(f(α))−ln(1−f(α)))¿ 1 f(α)
∂ f(α)
∂ αi + 1 1−f(α)
∂ f(α)
∂ αi = 1
f(α)(1−f(α))
∂ f(α)
∂ αi ,
∂
∂ αi
(
ln( (
1−f(fα(α) ))
/(
1−gg(α(α) )) ) )=∂ α∂i(
ln(
1−ff(α()α))
−ln(
1−g(αg()α)) )
=f(α)(1−1 f(α)) ∂ f∂α(αi)−(A2)g(α)(1−1 g(α)) ∂ g∂ α(αi ),
∂
∂ αi
(
ln(
fg((αα))) )
=∂ α∂i(lnf (α)−lng(α))= 1
f(α)
∂ f (α)
∂ αi − 1 g(α)
∂ g(α)
∂ αi , (A3)
where α=(α1, α2, … , αn)'∈Rn , i=1, 2,… , n .
Nested probability formulas based on the mediator and outcome logistic models Let C denote the set of adjustment variables. Under identifying and modeling
assumptions (1-2) from the main text, the nested probability P
(
Y(a , M(a¿))=1|
C=c)
forexposure levels a and a¿ is expressed as follows:
P
(
Y(a , M(a¿))=1|
C=c)
¿P(Y=1|A=a , M=1,C=c)P(M=1|A=a¿, C=c)
+P(Y=1|A=a , M=0,C=c)P(M=0|A=a¿, C=c)
¿ exp(θ0+θ1a+θ2+θ3a+θ4' c)
1+exp(θ0+θ1a+θ2+θ3a+θ4' c2)∙
exp(β0+β1a¿+β2' c)
1+exp(β0+β1a¿+β2'c)
+exp(θ0+θ1a+θ4' c)
1+exp(θ0+θ1a+θ4' c)∙
1
1+exp(β0+β1a¿+β2' c).
Let g(a , a¿, c) denote this last expression:
g(a , a¿, c)= exp(θ0+θ1a+θ2+θ3a+θ4'
c)
1+exp(θ0+θ1a+θ2+θ3a+θ4' c)∙ exp(β0+β1a¿+β2'
c) 1+exp(β0+β1a¿+β2'c)
(A4)
+exp(θ0+θ1a+θ4'c)
1+exp(θ0+θ1a+θ4' c)∙ 1
1+exp(β0+β1a¿+β2'c).
Then, using general formulas (A1), the partial derivatives of g(a , a¿, c) with respect to each of the coefficients are:
∂ g(a , a¿, c)
∂ β0
¿ exp(θ0+θ1a+θ2+θ3a+θ4' c)
1+exp(θ0+θ1a+θ2+θ3a+θ'4c)∙ exp(β0+β1a¿+β2' c)
(1+exp(β0+β1a¿+β2' c))2
−exp(θ0+θ1a+θ4' c)
1+exp(θ0+θ1a+θ4' c)∙ exp(β0+β1a¿+β2' c)
(1+exp(β0+β1a¿+β2'c))2
¿ exp(β0+β1a¿+β2' c)
(
1+exp(β0+β1a¿+β2'c))
2×
(
1+expexp(θ(θ0+θ0+1θa+θ1a+θ2+θ2+θ3a+3a+θ4'θc4')c)− exp(θ0+θ1a+θ4' c) 1+exp(θ0+θ1a+θ'4c))
,∂ g(a , a¿, c)
∂ β1 =a¿∙∂ g(a , a¿, c)
∂ β0 ,
∂ g(a , a¿, c)
∂ β2i =ci∙∂ g(a , a¿, c)
∂ β0 ,i=1, … , k ,
∂ g(a , a¿, c)
∂θ0
¿ exp(θ0+θ1a+θ2+θ3a+θ4' c)
(1+exp(θ0+θ1a+θ2+θ3a+θ4' c))2∙
exp(β0+β1a¿+β2' c) 1+exp(β0+β1a¿+β2'c)
+exp(θ0+θ1a+θ'4c)
(1+exp(θ0+θ1a+θ'4c))2∙
1
1+exp(β0+β1a¿+β2'c),
∂ g(a , a¿, c)
∂θ1 =a ∙∂ g(a , a¿, c)
∂ θ0 ,
∂ g(a , a¿, c)
∂θ2
¿ exp(θ0+θ1a+θ2+θ3a+θ4' c)
(1+exp(θ0+θ1a+θ2+θ3a+θ4' c))2∙
exp(β0+β1a¿+β2'c)
1+exp(β0+β1a¿+β2' c),
∂ g(a , a¿, c)
∂θ3 =a ∙∂ g(a , a¿, c)
∂ θ2 ,
∂ g(a , a¿, c)
∂ θ4i =ci∙∂ g(a , a¿, c)
∂ θ0 ,i=1, … , k ,
where k is the cardinal number of C .
Thus, the gradient of the scalar function g(a , a¿, c) with respect to the vector (β , θ)=(β0, β1, β21,… , β2k,θ0, θ1, θ2,θ3, θ41, …,θ4k)'
is
∇(g(a , a¿, c))=
(
∂ g(a , a∂ β¿, c),∂ g(a , a¿, c)∂ θ
)
' (A5)where
∂ g(a , a¿, c)
∂ β =
(
∂ g(∂ βa , a0¿, c),∂ g(a ,a¿, c)
β1 ,∂ g(a , a¿, c)
∂ β21 , …,∂ g(a , a¿, c)
∂ β2k
)
,∂ g(a , a¿, c)
∂ θ =
(
∂ g(a , a∂ θ0¿, c),∂ g(a ,a¿, c)
∂θ1 ,∂ g(a , a¿, c)
∂θ2 ,∂ g(a , a¿, c)
∂ θ3 ,∂ g(a , a¿, c)
∂θ41 , … ,∂ g(a , a¿, c)
∂ θ4k
)
.Delta method for mediation exact regression-based odds ratios We define the following notation:
^g(a , a¿, c)=g(a ,a¿, c)
|
(β , θ)=(^β ,θ^),∇(g^(a , a¿, c))=∇(g(a , a¿, c))
|
(β , θ)=(^β ,θ^),where ∇(g(a , a¿, c)) is defined in (A5).
We can express the regression-based exact ¿a , aNDE¿|c and ¿a , aNIE¿|c in terms of g(a , a¿, c) defined in (A4) as follows:
¿a , aNDE¿|c=
g(a , a¿, c) 1−g(a , a¿, c)
g(a¿, a¿, c) 1−g(a¿, a¿, c)
,¿a , aNIE¿c=
g(a , a , c) 1−g(a , a , c)
g(a , a¿, c) 1−g(a , a¿, c)
.
To construct the 95% confidence intervals (CIs) for the exact natural effect OR by first-order multivariate delta method (1), we have applied the same approach as in (2), that is we have expressed standard errors (se) for ln
(
¿^a ,a¿|cNDE
)
and ln(
¿^a ,a¿|cNIE
)
according to the following approximate formulas:se
(
ln(
¿^a ,a¿|cNDE
) )
≈√
∇(
ln(
¿^a ,aNDE¿|c) )
'∙ ∑∙∇(
ln(
¿^a ,aNDE¿|c) )
❑,se
(
ln(
¿^a ,a¿|cNIE
) )
≈√
∇(
ln(
¿^a ,aNIE¿|c) )
'∙ ∑∙∇(
ln(
¿^a ,aNIE¿|c) )
❑,where ∑=diag
{
∑^β,∑θ^}
is a block matrix, ∑^β and ∑θ^ are the covariance matrices for the vectors ^β and θ^ , respectively. The gradients of ln(
¿^a ,a¿|cNDE
)
and ln(
¿^a ,a¿c NIE)
areexpressed using ∇(g^(a , a¿, c)) as follows:
∇
(
ln(
¿^a , aNDE¿|c) )
¿ ∇(g^(a ,a¿, c))
g^(a , a¿, c)(1−^g(a , a¿, c))−
∇(g^(a¿, a¿, c))
^g(a¿, a¿,)(1−^g(a¿, a¿, c)),
∇
(
ln(
¿^a , a¿|c NIE) )
¿ ∇(^g(a , a , c))
g^(a , a , c)(1− ^g(a , a , c))−
∇(^g(a , a¿, c))
g^(a , a¿, c)(1−^g(a , a¿, c)).
Thus, ln
(
¿^a ,a¿|cNDE
)
± Φ−1(0.975)∙ se(
ln(
¿^a , aNDE¿|c) )
,ln
(
¿^a ,a¿|cNIE
)
± Φ−1(0.975)∙ se(
ln(
¿^a , aNIE¿|c) )
are the 95% CIs for ln
(
¿a ,a¿|cNDE
)
and ln(
¿a ,a¿|cNIE
)
, respectively. Therefore, 95% CIs for ¿a , aNDE¿|c and ¿a , aNIE¿|c are given by¿^a , aNDE¿|c∙exp
(
±Φ−1(0.975)∙ se(
ln(
¿^a ,aNDE¿|c) ) )
,¿^a , aNIE¿|c∙exp
(
±Φ−1(0.975)∙ se(
ln(
¿^a ,aNIE¿|c) ) )
.Finally, we have for the total effect odds ratio ¿a , aTE¿|c that ln
(
¿^a ,a¿|cTE
)
=ln(
¿^a , a¿|cNDE
)
+ln(
¿^a ,a¿|c NIE)
,∇
(
ln(
¿^a , a¿|cTE
) )
=∇(
ln(
¿^a , a¿|cNDE
) )
+∇(
ln(
¿^a ,a¿|c NIE) )
and
se
(
ln(
¿^a ,a¿|cTE
) )
≈√
∇(
ln(
¿^TEa ,a¿|c) )
' ∙∑∙∇(
ln(
¿^a , aTE¿|c) )
.Thus, a 95% CI for ln
(
¿a ,a¿|cTE
)
isln
(
¿^a ,a¿|cTE
)
± Φ−1(0.975)∙ se(
ln(
¿^a , aTE¿|c) )
,and, consequently, approximate 95% CI for ¿a , aTE¿|c is given by
¿^a , aTE¿|c∙exp
(
±Φ−1(0.975)∙ se(
ln(
¿^a ,aTE¿|c) ) )
.Delta method for exact mediation regression-based risk ratios We have for the RR scale that
RRa ,aNDE¿|c= g(a , a¿, c)
g(a¿, a¿, c), RRa ,a¿|c
NIE = g(a , a , c) g(a , a¿,c),
and, correspondingly, ln
(
RR^a , a¿|cNDE
)
=ln(^g(a , a¿, c))−ln(^g(a¿, a¿, c)),ln
(
RR^a , a¿|cNIE
)
=ln(^g(a , a , c))−ln(g^(a ,a¿, c)).The equation (A3) implies that
∇
(
ln(
RR^a ,a¿|cNDE
) )
=∇(^g(a , a¿, c))
^g(a , a¿,c) −
∇(g^(a¿, a¿, c))
^g(a¿, a¿, c) ,
∇
(
ln(
RR^a ,a¿|cNIE
) )
=∇^g(g^(a , a , c(a , a , c)))−∇(^g(a , a¿, c))
^g(a , a¿, c) . Thus,
se
(
ln(
^RRa , a¿|cNDE
) )
≈√
∇(
ln(
RR^a ,aNDE¿|c) )
' ∙∑∙∇(
ln(
^RRa ,aNDE¿|c) )
,se
(
ln(
^RRa , a¿|cNIE
) )
≈√
∇(
ln(
RR^a ,aNIE¿|c) )
' ∙∑∙∇(
ln(
^RRa ,aNIE¿|c) )
,and 95% CIs for RRa ,aNDE¿|c and RRa ,aNIE¿|c can be approximated by
^RRa ,aNDE¿|c∙exp
(
± Φ−1(0.975)∙ se(
ln(
^RRa ,aNDE¿|c) ) )
,^RRa ,aNIE¿|c∙exp
(
± Φ−1(0.975)∙ se(
ln(
^RRa ,aNIE¿|c) ) )
.Finally, we have for the total effect RRa ,aTE¿|c=RRa ,aNDE¿|c∙ RRa , aNIE¿|c : ln
(
RR^a , a¿|cTE
)
=ln(
^RRa , a¿|cNDE
)
+ln(
RR^a ,a¿|c NIE)
.∇
(
ln(
RR^a ,a¿|cTE
) )
=∇(
ln(
^RRa , a¿|cNDE
) )
+∇(
ln(
RR^a ,a¿|c NIE) )
,se
(
ln(
^RRa , a¿|cTE
) )
≈√
∇(
ln(
RR^a ,aTE¿|c) )
' ∙∑∙∇(
ln(
^RRa ,aTE¿|c) )
.The 95% CI for RRa ,aTE¿|c can be approximated by
^RRa ,aTE¿∨c∙exp
(
± Φ−1(0.975)∙ se(
ln(
RR^TEa ,a¿|c) ) )
.Delta method for exact mediation regression-based risk differences We have for the RD scale:
RDa ,aNDE¿|c=g(a , a¿, c)−g(a¿, a¿, c), RDa ,aNIE¿|c=g(a , a , c)−g(a , a¿, c), RDTEa ,a¿|c=RDa , aNDE¿|c+RDa , aNIE¿|c,
∇
(
^RDa ,a¿|cNDE