Skip to main content
Lippincott Open Access logoLink to Lippincott Open Access
. 2022 Oct 5;33(6):840–842. doi: 10.1097/EDE.0000000000001540

Exact Mediation Analysis for Ordinal Outcome and Binary Mediator

Elena Stanghellini a,, Maria Kateri b
PMCID: PMC10896191  PMID: 36220580

Abstract

With reference to a single mediator context, this brief report presents a model-based strategy to estimate counterfactual direct and indirect effects when the response variable is ordinal and the mediator is binary. Postulating a logistic regression model for the mediator and a cumulative logit model for the outcome, we present the exact parametric formulation of the causal effects, thereby extending previous work that only contained approximated results. The identification conditions are equivalent to the ones already established in the literature. The effects can be estimated by making use of standard statistical software and standard errors can be computed via a bootstrap algorithm. To make the methodology accessible, routines to implement the proposal in R are presented in the eAppendix; http://links.lww.com/EDE/B962. We also derive the natural effect model coherent with the postulated data-generating mechanism.

Keywords: Binary mediator, Causal effects, Mediation, Natural effect model, Ordinal outcome


Many epidemiologic problems involve the quantification of the causal effect of a treatment on an outcome and the decomposition of this effect into the direct and indirect one, this second due to the presence of a possible mediator. A mediator is a variable that is a response to the treatment and that in turn influences the outcome.

Let X be a treatment of interest, M be the mediator, and Y the outcome of interest. We assume that the data-generating process, possibly after conditioning on a set C of covariates, is as described in the Figure. Mediation analysis involves the definition and estimation of effects on the outcome Y when, possibly contrary to fact, the value of X is set to x versus a baseline value x*.1,2

FIGURE.

FIGURE.

Data-generating process for one outcome Y and one mediator M.

We assume that the outcome of interest is a categorical random variable with levels that can be ordered. Differently from what presented in VanderWeele et al,3 we do not make the assumption that the response Y is highly unbalanced, with one reference category having a high conditional probability (possibly higher than 0.90). Furthermore, we focus on a situation where the mediator M is binary. We present the closed form of the counterfactual effects for the described context and detail how to perform inference when a random sample drawn from the population is available. Standard statistical software may be used for the implementation of the proposed methodology. This paper extends the derivation in Doretti et al,4 where the binary M—binary Y case is presented, and fills the current gap on existing parametric methods for causal inference and mediation to cover the described situation. Since the closed form of the effects is presented, the derivations also allow formulation of the natural effect model coherently with the postulated data-generating process.

CONCEPTS AND DEFINITIONS

Let M(x), Y(x) be, in order, the value that M and Y would take if X were set to x. Let Y(x,m) be the value of Y if X were set to x and M were set to m. Finally let Y(x,M(x)) be the value that Y would take were X set to x and M set to M(x), that is, the value that it would have naturally attained if X were set to x. These values are called potential outcomes. For more details see VanderWeele,2 Chapters 1–2.

Causal effects involve contrasts on the potential outcome for X set to x or x*, with x* a baseline level. VanderWeele et al3 introduced the causal effects for an ordinal outcome on a cumulative odds ratio scale. As a driving example, we consider the study on the mediating effect of depression on the pathway between socioeconomic variables and self declared health status in the population of adolescents in United States; see Huang et al.5 Let X represent the socioeconomic status (SES), counting the number of university degrees of parents, with x=0, and Y represent the self-rated health (SRH), measured on a five-point Likert scale, with generic level j, j = 1,...,5. Let M represent the indicator of presence (m = 1) or absence (m = 0) of depression. Let P(Y(x)>j|C=c) be the probability that, conditional on covariates C=c, the potential outcome is larger than j. The total causal effect TCEj is the ratio between the odds of (Y(x)>j|C=c) and the odds of (Y(x)>j|C=c), and describes the effect on the odds that the potential outcome exceeds level j of an external intervention that increases the level of X from the baseline level x to a higher level x. Let x=2, for instance. If the odds is greater than one, keeping constant all other covariates C, then increasing the number of parents’ university degrees from x=0 to x=2 results in a higher probability that an adolescent presents a SRH larger than j. This overall effect of the external intervention may be induced by both the direct effect of SES on SRH and the indirect effect due to the higher/lower probability of an adolescent to develop depression, which in turn influences the outcome. In order to assess the relative impact, the natural direct (NDEj) and indirect effect (NIEj) can be computed, with TCEj=NDEj×NIEj. The NDEj is the ratio between the odds of (Y(x,M(x))>j|C=c) and the odds of (Y(x,M(x))>j|C=c) and measures the impact on the odds that the potential outcome exceeds level j while keeping the mediator at the level it would naturally attain if the treatment were kept to the baseline level. In our example, if this odds ratio is greater than one, then increasing the number of parents’ university degrees from x=0 to x=2, while keeping the indicator of depression to the value naturally taken if no parent holds a university degree, results in a higher probability than an adolescent present a SRH larger than j. This effect is attributable to the direct effect of SES only, as the conditional probability of the mediator is evaluated at the baseline value. Likewise, the natural indirect effect NIEj is the ratio between the odds of (Y(x,M(x))>j|C=c) and the odds of (Y(x,M(x))>j|C=c) and measures the impact on the odds that the potential outcome exceeds level j when only the mediator is varying from its natural level at baseline to its natural level under x. In our example, if the odds ratio is greater than one, then varying the indicator of depression from the value naturally taken under x=0 to the value naturally taken under x=2, while keeping the number of parents’ university degree at x=2, results in a higher probability that an adolescent present a SRH larger than j. This second effect is the indirect one, as it is due to the influence of the mediator only, as its conditional distribution is the only element that varies. Finally, we also introduce the controlled direct effect CDEj(m) for M=m, that measures the effect of varying X on the odds of (Y(x,m)>j|C=c), while keeping the mediator constant to a fixed value m. In our example, if it is greater than one, then increasing the number of university degrees from x=0 to x=2, while keeping the value of the mediator fixed to either presence (m=1) or absence (m=0) of depression increases the probability than an adolescent present a SRH larger than j.

To identify the causal effects, further conditions are necessary as in VanderWeele et al.3 A detailed presentation of these causal effects and their identification conditions is in eAppendix A.1; http://links.lww.com/EDE/B962. We here summarize them by assuming that, possibly after conditioning on observed covariates C, the DAG in the Figure describes the data-generating mechanism and no unobserved confounders exist; see Pearl,6 Chapter 7. We further assume a parametric formulation of the data-generating process according to models (1) and (2), provided in next section.

EXACT PARAMETRIC FORMULATION OF NATURAL EFFECTS

We assume that

logitP(M=1|X=x,C=c)=γ0+γXx+γCc (1)

and

logitP(Yj|X=x,M=m,C=c)=αj(βXx+βMm+βXMxm+βCc),j=1,,J1 (2)

where

logitP(Yj|X=x,M=m,C=c)=logP(Yj|X=x,M=m,C=c)P(Y>j|X=x,M=m,C=c)

is the cumulative logit for Y. While (1) is a standard logistic model, (2) is a proportional odds model, see Kateri,7 Chapter 8, for more details. Notice that we allow for the interaction between X and M in the outcome equation. If the assumption of proportionality is not met, the coefficients in the outcome regression may vary with j, as in VanderWeele et al.3 We do not pursue this further here, as it is a trivial extension of our proposed derivations. Let Dj=I(Yj) be an indicator variable that takes value 1 if Yj and 0 otherwise. It then follows (see eAppendix A.2; http://links.lww.com/EDE/B962 for details) that the marginal cumulative logit model of Y against X can be so written

logitP(Yj|X=x,C=c=αj(βXx+βCc)log[1+expg0j(x;c)1+expg1j(x;c)],j=1,,J1 (3)

where the term in squared brackets is the relative risk of M¯=1M for varying Dj in the distribution of X = x and C = c. The parametric expression of the functions gjd(x;c), d = 0,1, is in (11) of eAppendix A.2; http://links.lww.com/EDE/B962.

In what follows all effects should be interpreted as conditional on covariates C = c. For each level j of the outcome Y, the total causal effect involves a contrast between the marginal model evaluated at two different values of X, that is, x and a baseline value x*. We then have

logTCEj=βX(xx)log[1+exp g1j(x,c)1+exp g0j(x,c)]+log[1+exp g1j(x,c)1+exp g0j(x,c)]

while

logCDEj(m)=(βX+βXMm)(xx*).

It follows from the proportional odds assumption that the CDEdoes not vary with the level j.

As shown in VanderWeele et al,3 the identification assumptions imply that

logitP(Y(x,M(x))j|C=c)=
logmP(Yj|X=x,M=m,C=c)P(M=m|X=x*,C=c)mP(Y>j|X=x,M=m,C=c)P(M=m|X=x*,C=c).

The parametric expression of the natural effects can be derived by plugging into the probabilities as implied from model (1) and (2). Let gdj(x,x;c) as in (13) of eAppendix A.2; http://links.lww.com/EDE/B962. After some derivations, that closely resemble the work in Doretti et al4 for the binary-binary case, it is possible to show that

logNDEj=βX(xx)log[1+expg1j(x,x;c)1+expg0j(x,x;c)]+log[1+expg1j(x;c)1+expg0j(x;c)]

while

logNIEj=log[1+expg1j(x;c)1+expg0j(x;c)]+log[1+expg1j(x,x;c)1+expg0j(x,x;c)].

The above expressions can be further simplified, after their parametric formulation is made explicit.

Notice that the previous derivations allow formulation of the counterfactual model of Y(x,M(x)), in a way that is coherent with the parametric expressions of the natural direct and indirect effects above introduced. In fact, gdj(x,x;c) is obtained after crossing the conditional distribution of Y given M = m and X = x with the conditional distribution of M given X = x*, that is

gdj(x,x;c)=logP(Dj=d|M=1,X=x,C=c)P(Dj=d|M=0,X=x,C=c)+logP(M=1|X=x,C=c)P(M=0|X=x,C=c)

with gdj(x,x;c)=gdj(x;c). It then follows that the counterfactual model is

logitP(Y(x,M(x))j|C=c)=αj(βXx+βCc)log[1+expg0j(x,x;c)1+expg1j(x,x;c)]

for j=1,,J1. This equation, which can be seen as a natural effect model as in Lange et al,8 shows that the counterfactual cumulative logit model implied by the postulated data-generating mechanism is a complex function of x and x* and of the parameters of (1) and (2).

An insight to the causal effects estimates, their precision and the effect of sparsity are gained via simulation studies that are presented in eAppendix B.1; http://links.lww.com/EDE/B962. The corresponding bootstrap standard deviations and percentile bootstrap 95% confidence intervals (CIs) for the causal effect measures are also provided. All the associated R-code is provided in eAppendix B.2; http://links.lww.com/EDE/B962.

DISCUSSION

This paper extends previous work on parametric mediation analysis to cover a situation with a binary mediator and an ordinal outcome, by deriving exact formulation of the causal effects on the log odds ratio scale. The formulation of the natural effect model for the postulated data-generating mechanism is also derived, thereby allowing the estimation of effects on a different scale. The proposal makes use of well-known statistical models, such as the logistic and the cumulative ordered model, both of them widely used in epidemiologic studies. The methodology inherits all advantages and limitations of the context. In particular, we here stress the importance of sensitivity analysis to assess that the identification conditions are met in order to make valid causal statements, see VanderWeele,2 Chapter 3.

ACKNOWLEDGMENTS

Elena Stanghellini acknowledges D.A.A.D. for a research grant (Funding Programme Num. 57552335) that supported her visit to Maria Kateri, during which this paper was developed.

Supplementary Material

ede-33-840-s001.pdf (2MB, pdf)

Footnotes

The authors report no conflicts of interest.

Supplemental digital content is available through direct URL citations in the HTML and PDF versions of this article (www.epidem.com).

REFERENCES

  • 1.Pearl J. (2012). The mediation formula: A guide to the assessment of causal pathways in nonlinear models. Wiley Online Library.
  • 2.VanderWeele TJ. (2015) Explanation in Causal Inference: Methods for Mediation and Interaction. New York, USA: Oxford University Press. [Google Scholar]
  • 3.VanderWeele TJ, Zhang Y, Limb P. Mediation Analysis with an Ordinal outcome. Epidemiology. 2016;27:651–655. [DOI] [PubMed] [Google Scholar]
  • 4.Doretti M, Raggi M, Stanghellini E. Exact parametric causal mediation analysis for a binary outcomes with a binary mediator. Statistical Methods and Application. 2022;31:87–108. [Google Scholar]
  • 5.Huang B, Siva S, Succop P, et al. Statistical assesment of mediational effects for logistic mediational models. Stat Med. 2004;23:2713–2728. [DOI] [PubMed] [Google Scholar]
  • 6.Pearl J. (2009). Causality: Models, Reasoning, and Inference (2nd ed.). New York, NY, USA: Cambridge University Press. [Google Scholar]
  • 7.Kateri M. (2014). Contingency Table Analysis: Methods and Implementation Using R. Birkhäuser/Springer, New York. [Google Scholar]
  • 8.Lange T, Vansteelandt S, Bekaert M. A simple unified approach for estimating natural direct and indirect effects. Am J Epidemiol. 2012;1:131–158. [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

ede-33-840-s001.pdf (2MB, pdf)

Articles from Epidemiology (Cambridge, Mass.) are provided here courtesy of Wolters Kluwer Health

RESOURCES