DÄ internationalArchive41/2023Mediation Analysis in Medical Research

Review article

Mediation Analysis in Medical Research

Part 31 of a Series on Evaluation of Scientific Publications

Dtsch Arztebl Int 2023; 120: 681-7. DOI: 10.3238/arztebl.m2023.0175

Tönnies, T; Schlesinger, S; Lang, A; Kuss, O

Background: Mediation analysis addresses the question of the mechanisms by which an exposure causes an outcome. This article is intended to convey basic knowledge of statistical mediation analysis.

Methods: Selected articles and examples are used to explain the principle of mediation analysis.

Results: The goal of mediation analysis is to express an overall exposure effect as a combination of an indirect and a direct effect. For example, it might be of interest whether the increased risk of diabetes (outcome) due to obesity (exposure) is mediated by insulin resistance (indirect effect), and, if so, how much of a direct effect remains. In this example, insulin resistance is a potential mediator of the effect of obesity on the risk of diabetes. In general, for a mediation analysis to be valid, more confounders must be taken into account than in the estimation of the overall effect size. A regression-based approach can be used to ensure the consideration of all relevant confounders in a mediation analysis.

Conclusion: By decomposing the overall exposure effect into indirect and direct components, a mediation analysis can reveal not just whether an exposure causes an outcome, but also how. For a mediation analysis to be valid, however, multiple assumptions must be satisfied that cannot easily be checked, potentially compromising such analyses as compared to the estimation of an overall effect.

LNSLNS

The question of causality lies at the core of empirical medical research, and there are various approaches to examine causal relationships (1, 2). The effect of a new treatment on a clinical endpoint is examined in randomized controlled trials (RCTs), while the effect of exposures on the risk of disease is assessed in cohort studies. Common to these studies is the fact that they examine causal relationships between a treatment or exposure and an outcome. They deal, therefore, with the question of whether an exposure is the cause of an outcome (3, 4, 5). Effect estimation is based on the theory of causal inference (6). This mathematical theory makes assumptions which must be satisfied to correctly estimate causal effects (Box). The key difference between observational studies and RCTs is that in RCTs these assumptions are fulfilled by the study design, whereas they are usually not fulfilled in observational studies, subsequently requiring more complex statistical procedures. In most cases, it is not possible to verify whether these assumptions are fulfilled in observational studies despite statistical adjustments.

Necessary assumptions required to estimate causal effects
Box
Necessary assumptions required to estimate causal effects

One example for the examination of a causal relationship is the question of whether obesity increases the risk of type 2 diabetes. The exact mechanisms leading to this increased risk are not necessarily the initial focus of interest. However, from both a scientific and a medical care perspective, these mechanisms may well be of relevance. For example, it might be of interest to see whether the aforementioned relationship between obesity and diabetes is in part mediated by insulin resistance. This insight could both influence treatment decisions and initiate research projects to develop new therapies to prevent insulin resistance.

Mediation analysis offers a way of investigating these mechanisms (4, 5). It investigates the mechanisms by which an exposure causes an outcome. It therefore not only examines whether there actually is a causal relationship but also how it arises. The focus here is on factors that “mediate” the relationship between exposure and outcome (Latin: “mediator” = go-between or facilitator). In the example above, insulin resistance would be a potential mediator between the exposure “obesity” and the outcome “diabetes”.

Because of this additional complexity of mediation analysis and because such analyses are increasingly applied in medical research, the aim of the present article is to provide a basic understanding of statistical mediation analysis. The focus here is on a correct interpretation of the results and on possible limitations and pitfalls of mediation analysis.

Methods

The principle of mediation analysis will be described here using directed acyclic graphs (DAGs), also known as causal diagrams (7, 8, 9), and drawing on selected examples. Moreover, an explanation is provided on how mediation analysis can be biased and how these biases can be avoided.

Results

Causal diagrams and mediation (analysis)

Assumptions about causal relationships are made and presented in causal diagrams based on expert knowledge. These causal diagrams form the basis for addressing a scientific question (7, 8, 9). This serves to translate specialized content knowledge into statistical relationships. The insights gained from this can then be applied to data collection and analysis.

Causal relationships are represented in a causal diagram by directed arrows from the cause (for example, an exposure) to its effect (for example, the outcome). As presented in Figure 1 with reference to the example mentioned above, insulin resistance is a potential mediator for the effect of obesity on diabetes.

Directed Acyclic Graphs (DAG) to demonstrate mediation analysis—decomposition of the total effect into a direct and an indirect effect
Figure 1
Directed Acyclic Graphs (DAG) to demonstrate mediation analysis—decomposition of the total effect into a direct and an indirect effect

The aim of mediation analysis is to break down, or decompose, the total exposure effect in one or more indirect effects and one direct effect (4, 5). In our example, therefore, the aim would be to decompose the total effect of the risk of diabetes into two parts: one part mediated by the obesity-related risk of insulin resistance (indirect effect) and one part caused directly by obesity (i.e., not via a resistance to insulin). For further clarity, this example is developed in the next section.

A hypothetical example

Figure 2 presents a hypothetical, highly simplified study situation involving 100 participants who differ at baseline only with respect to their obesity status. We assume that obesity doubles the risk for insulin resistance as compared with individuals without obesity. Consequently, ten non-obese and 20 obese study participants have insulin resistance in Figure 2a. We also assume that individuals without obesity and without insulin resistance have a 20% risk of developing diabetes and that obesity and insulin resistance increase the risk of diabetes in comparison with individuals without obesity and insulin resistance by 20 and 30 percentage points, respectively. This results in different risks of developing diabetes (Table 1).

Decomposition of the effect of obesity on the risk of diabetes into a direct and an indirect effect
Figure 2
Decomposition of the effect of obesity on the risk of diabetes into a direct and an indirect effect
The risk of diabetes as a function of the exposure “obesity” and the mediator “insulin resistance”
Table 1
The risk of diabetes as a function of the exposure “obesity” and the mediator “insulin resistance”

If these probabilities are applied to the hypothetical study participants in Figure 2a, this results in a risk of developing diabetes of 26% for non-obese and 52% for obese participants, which corresponds to a risk difference of 26 percentage points. So obesity increases the risk of diabetes altogether by 26 percentage points (corresponding to 13 additional cases of diabetes).

The decomposition of the total effect into an indirect and a direct effect is presented in Figures 2b and 2c. In order to calculate the direct effect (Figure 2b), we “eliminate” the impact of obesity on the risk of insulin resistance. In this context, “eliminate“ means that we calculate the figures as in Figure 2a, with the only difference that obesity does not have an impact on the risk of insulin resistance. As a result, the proportion of study participants with insulin resistance is the same in individuals with and in those without obesity (20%). With respect to the causal diagram in Figure 1, proceeding like this corresponds to “eliminating” the arrow from obesity to insulin resistance. Now, if the specified diabetes risks are applied to Figure 2b, there is a risk of developing diabetes of 26% in non-obese and 46% in obese study participants. After “eliminating” the relationship between the exposure “obesity” and the mediator “insulin resistance”, there subsequently remains a direct effect of 20 percentage points (corresponding to ten additional cases of diabetes). In this example, the direct effect answers the question: “How great would the effect of obesity on the risk of diabetes be if obesity had no impact on the development of insulin resistance?”

For calculating the indirect effect (Figure 2c), we assume that obesity has no direct effect on the risk of diabetes and equate the risk of study participants without obesity to the risk of study participants with obesity (40 %). In the absence of insulin resistance, the presence of obesity therefore no longer has a direct impact on the risk of diabetes which it increases only indirectly via an increased risk for insulin resistance. This results in a risk of developing diabetes of 46% in non-obese and 52% in obese study participants. So, after comparing the risk of diabetes in non-obese with that of obese participants, there remains an indirect effect of six percentage points (corresponding to three additional cases of diabetes). The indirect effect answers the question: “How great would the effect of obesity on the risk of diabetes be if obesity were to influence the risk of diabetes exclusively via the development of insulin resistance?”

The sum of the direct and indirect effects gives the total effect of 26 percentage points, or 13 additional cases of diabetes. In mediation analysis, the proportion of the total effect resulting from the indirect effect is often calculated (proportion mediated [PM]). The PM is defined as the ratio of the indirect effect over the total effect. In this example, the PM is six percentage points divided by 26 percentage points, which is 23%. Consequently, in our example, 23% of the total effect of obesity is due to the indirect effect via insulin resistance.

The manual calculation of the direct and indirect effects shown in Figure 2 is used here only to make mediation analysis as comprehensible as possible. In research practice, a wide range of statistical procedures are used for this purpose. For the sake of clarity, we have assumed in our example that there are no confounders (refer to [10] for further information) which might bias the estimation of the effect of obesity on the risk of diabetes. A potential confounder for the relationship between obesity and diabetes would be, for example, physical activity, since it can influence the risk for obesity as well as the risk for diabetes. By mixing the effect of the exposure with the confounder effect, the estimation of the causal relationship between exposure and outcome is biased. A number of statistical methods are available to adjust for potential confounders when estimating causal effects, for example, regression analysis (11). One way to correct for confounding in mediation analysis is illustrated by the following real-world example from diabetes research.

Applied example from diabetes research

Boonpor et al. (12) ) examined the effect of a fish-based diet in comparison with a meat-based diet on the risk of diabetes and to what extent this effect is mediated by obesity. The motivation for this study was the question of whether a fish diet could have other (direct) effects on the risk of diabetes apart from its obesity-inhibiting effect. For this purpose, the data of around 200 000 study participants from the UK Biobank were analyzed. Over a median follow-up period of 5.4 years, 5067 new cases of diabetes were diagnosed in this cohort. The analysis adjusted for several confounders which could bias the relationship between a fish-based diet and the incidence of diabetes. For example, it was assumed that age affects both diet and the risk of diabetes, which would create a bias due to the confounder “age”. The causal relationships examined in this study are presented in Figure 3. Confounders are presented in a causal diagram as characteristics with arrows leading to both the exposure and the outcome. Figures 3 clearly illustrates an important difference between mediation analysis and “conventional” effect estimations in which only the total effect from the exposure to the outcome is of interest. With conventional effect estimations, confounding must be adjusted for by all characteristics that influence both the exposure and the outcome. On the other hand, for valid mediation analysis, the effects of the exposure on the mediator (fish-based diet → obesity) and of the mediator on the outcome (obesity → diabetes) are also relevant. These effects can also be biased by confounding. Consequently, the analysis must include adjustments for exposure-mediator confounders and mediator-outcome confounders in addition to exposure-outcome confounders.

Directed acyclic graph showing the causal relationship between a fish-based diet, obesity, and diabetes
Figure 3
Directed acyclic graph showing the causal relationship between a fish-based diet, obesity, and diabetes

Regression-based mediation analysis

In their mediation analysis, Boonpor et al. (12) used regression models to adjust for confounding. An introduction to regression analysis is provided by Schneider et al. (11). It is important to note that two regression models are usually computed for mediation analysis. The first regression model estimates the relationship between exposure and outcome and the second between exposure and mediator. With respect to Figure 3, this means that the effect of a fish diet (exposure) on the incidence of diabetes (outcome) is estimated using the first regression model, and the effect of a fish diet on obesity (mediator) is estimated by the second model. Both regression models must adjust for all three confounder sets in Figure 3. Boonpor et al. (12) adjusted for several potential confounders (Table 2). The total, direct, and indirect effect can be estimated using mathematical equations based on the regression coefficients of both regression models (4). Depending on the research question, these equations are more or less complex and are implemented in standard statistical software. The confounder-adjusted analysis demonstrated a lower incidence rate by a factor of 0.56 for a fish-based diet in comparison with a meat-based diet. A reduction by a factor of 0.81 was attributable to the indirect effect via obesity, which corresponded to a PM of 31%.

Mediation analysis for the relationship between a fishbased diet, obesity, and the incidence of diabetes
Table 2
Mediation analysis for the relationship between a fishbased diet, obesity, and the incidence of diabetes

Practical implementation and interpretation of mediation analysis

The regression-based implementation of mediation analyses presented above is incorporated in a user-friendly manner in several statistical programs (for example, SAS, R, or Stata). This method may be used for different types of outcomes and mediators. The correct regression model to use is determined by the scale of the outcome variable in question. For example, relative risks or odds ratios for dichotomous outcomes can be estimated and broken down into direct and indirect effects. In Boonpor et al (12), the outcome was a time-to-event and the mediator a binary variable, so Cox regression and logistic regression were used, respectively.

The selection of confounders can be a challenge when implementing mediation analysis. As already mentioned, three types of confounding variables must be adjusted for in mediation analysis (Figure 3). It is important that the selection of confounders is justified by subject-matter reasons and not only data-driven. One way of making the selection of confounders easier is to use graphical representations of causal relationships in causal diagrams based on expert knowledge. Based on a causal diagram and mathematical rules, freely available software may be used to identify relevant confounders (for example, DAGitty) (13).

Mediation analysis is used for both RCTs and observational studies. However, in the mediation case more assumptions must be fulfilled than with conventional estimations of associations between exposure and outcome. A key assumption when estimating causal effects is that there are no unknown or unmeasured confounders. Usually it is not possible to verify whether this assumption is fulfilled in a given case. Because it is more difficult to fulfill this assumption in mediation analysis due to the three confounder sets which need to be adjusted for, mediation analysis is considered more prone to bias than studies that only estimate the total effect. Mediation analyses in RCTs have the advantage that confounding between the intervention and outcome and between the intervention and mediator are prevented by randomizing the intervention so that confounders can be disregarded for these relationships. However, mediator-outcome confounders must also be adjusted for in RCTs because the mediator is usually not randomized. In general, mediation analyses are therefore more susceptible to bias than conventional effect estimations.

In order to obtain valid effect estimates, it is an advantage if there is a clear chronological order between exposure, mediator, and outcome. Ideally, therefore, a dataset with (at least) three survey dates should be available. Otherwise it might not be guaranteed that, for example, the mediator follows the exposure and not vice versa. If the chronological order of exposure, mediator, and outcome is unclear, then the direction of the causal relationship is also unclear. An unequivocal chronological order is therefore also crucial for the interpretation of mediation analyses. In addition, attention should be paid to whether the confounders were identified with the help of expert knowledge, for example by using causal diagrams, and whether all three types of confounders were adjusted for. As with any study, mediation analyses should also be judged in the light of the overall available evidence.

Discussion

We have used examples to explain how mediation analyses can be implemented to decompose the effect of an exposure or intervention into a direct and an indirect effect. The regression-based approach provides an opportunity to perform mediation analyses. These procedures are flexible for use with various scales of the outcome and mediator and, unlike older methods, can also adjust for an interaction between the exposure and the mediator. However, these procedures do also have their limitations when dealing with more complex issues. For example, situations with more than one mediator require more extensive programming (5).

Therefore, the concepts and methods presented here can only give a brief insight into the principle of mediation analysis. The methodology can be expanded in many ways, for example, by decomposition of the total effect into more than two components (14), and alternatives to the regression-based approach (for example, [15, 16]) are also available. The fundamental principle, however, is the same for all methods: the decomposition of exposure effects into direct and indirect components with the aim of examining not only whether, but also how, an exposure causes an outcome.

Conflict of interest statement
OK received fees from Berlin Chemie for biostatistical counseling and education.

The other authors declare that they have no conflicts of interests.

Manuscript received on January 18, 2023; revised version accepted on July 12, 2023.

Translated from the original German by Dr. Grahame Larkin MD.

Corresponding author

Dr. PH Thaddäus Tönnies
German Diabetes Center (DDZ)

Institute for Biometrics and Epidemiology

Auf’m Hennekamp 65, 40225 Düsseldorf

thaddaeus.toennies@ddz.de

Cite this as:
Tönnies T, Schlesinger S, Lang A, Kuss O: Mediation analysis in medical research—part 31 of a series on evaluation of scientific publications. Dtsch Arztebl Int 2023; 120: 681–7. DOI: 10.3238/arztebl.m2023.0175

1.
Gianicolo EAL, Eichler M, Muensterer O, Strauch K, Blettner M: Methods for evaluating causality in observational studies—part 27 of a series on evaluation of scientific publications. Dtsch Arztebl Int 2020; 117: 101–7 VOLLTEXT
2.
Stang A: Eine Einführung in Kausalitätsprinzipien in der biomedizinischen Forschung. Gesundheitswesen 2014; 76: 874–82 CrossRef MEDLINE
3.
Richiardi L, Bellocco R, Zugna D: Mediation analysis in epidemiology: methods, interpretation and bias. Int J Epidemiol 2013; 42: 1511–9 CrossRef MEDLINE
4.
VanderWeele TJ: Mediation analysis: a practitioner‘s guide. Annu Rev Public Health 2016; 37: 17–32 CrossRef MEDLINE
5.
VanderWeele T: Explanation in causal inference: methods for mediation and interaction: Oxford University Press 2015 CrossRef MEDLINE PubMed Central
6.
Hernán M, Robins J: Causal inference: what If. Boca Raton: Chapman & Hall/CRC 2020.
7.
Schipf S, Knüppel S, Hardt J, Stang A: Directed acyclic graphs (DAGs)—Die Anwendung kausaler Graphen in der Epidemiologie. Gesundheitswesen 2011; 73: 888–92 CrossRef MEDLINE
8.
Greenland S, Pearl J, Robins JM: Causal diagrams for epidemiologic research. Epidemiology 1999; 10: 37–48 CrossRef
9.
Pearl J: Causal diagrams for empirical Research. Biometrika 1995; 82: 669–88 CrossRef
10.
Hammer GP, Prel J-Bd, Blettner M: Avoiding bias in observational studies: part 8 in a series of articles on evaluation of scientific publications. Dtsch Arztebl Int 2009; 106: 664–8 VOLLTEXT
11.
Schneider A, Hommel G, Blettner M: Linear regression analysis—part 14 of a series on evaluation of scientific publications. Dtsch Arztebl Int 2010; 107: 776–82 VOLLTEXT
12.
Boonpor J, Petermann-Rocha F, Parra-Soto S, et al.: Types of diet, obesity, and incident type 2 diabetes: findings from the UK biobank prospective cohort study. Diabetes Obes Metab 2022; 24: 1351–9 CrossRef MEDLINE PubMed Central
13.
Textor J, Hardt J, Knüppel S: DAGitty: A graphical tool for analyzing causal diagrams. Epidemiology 2011; 22: 745 CrossRef MEDLINE
14.
VanderWeele TJ: A unification of mediation and interaction: a 4-way decomposition. Epidemiology 2014; 25: 749–61 CrossRef MEDLINE PubMed Central
15.
Tchetgen Tchetgen EJ: Inverse odds ratio-weighted estimation for causal mediation analysis. Stat Med 2013; 32: 4567–80 CrossRef MEDLINE PubMed Central
16.
Imai K, Keele L, Tingley D: A general approach to causal mediation analysis. Psychol Methods 2010; 15: 309–34 CrossRef MEDLINE
German Diabetes Center (DDZ), Leibniz Center for Diabetes Research at the Heinrich-Heine University Düsseldorf, Institute for Biometrics and Epidemiology: Dr. PH Thaddäus Tönnies, Dr. oec. troph. Sabrina Schlesinger, Alexander Lang, Prof. Dr. sc. hum. Oliver Kuss
German Center for Diabetes Research, Partner Düsseldorf, München-Neuherberg, Germany: Dr. oec. troph. Sabrina Schlesinger, Prof. Dr. sc. hum. Oliver Kuss
Centre for Health and Society, Medical Faculty and University Hospital of Düsseldorf, Heinrich-Heine University Düsseldorf, Düsseldorf: Prof. Dr. sc. hum. Oliver Kuss
Necessary assumptions required to estimate causal effects
Box
Necessary assumptions required to estimate causal effects
Directed Acyclic Graphs (DAG) to demonstrate mediation analysis—decomposition of the total effect into a direct and an indirect effect
Figure 1
Directed Acyclic Graphs (DAG) to demonstrate mediation analysis—decomposition of the total effect into a direct and an indirect effect
Decomposition of the effect of obesity on the risk of diabetes into a direct and an indirect effect
Figure 2
Decomposition of the effect of obesity on the risk of diabetes into a direct and an indirect effect
Directed acyclic graph showing the causal relationship between a fish-based diet, obesity, and diabetes
Figure 3
Directed acyclic graph showing the causal relationship between a fish-based diet, obesity, and diabetes
The risk of diabetes as a function of the exposure “obesity” and the mediator “insulin resistance”
Table 1
The risk of diabetes as a function of the exposure “obesity” and the mediator “insulin resistance”
Mediation analysis for the relationship between a fishbased diet, obesity, and the incidence of diabetes
Table 2
Mediation analysis for the relationship between a fishbased diet, obesity, and the incidence of diabetes
1.Gianicolo EAL, Eichler M, Muensterer O, Strauch K, Blettner M: Methods for evaluating causality in observational studies—part 27 of a series on evaluation of scientific publications. Dtsch Arztebl Int 2020; 117: 101–7 VOLLTEXT
2.Stang A: Eine Einführung in Kausalitätsprinzipien in der biomedizinischen Forschung. Gesundheitswesen 2014; 76: 874–82 CrossRef MEDLINE
3.Richiardi L, Bellocco R, Zugna D: Mediation analysis in epidemiology: methods, interpretation and bias. Int J Epidemiol 2013; 42: 1511–9 CrossRef MEDLINE
4.VanderWeele TJ: Mediation analysis: a practitioner‘s guide. Annu Rev Public Health 2016; 37: 17–32 CrossRef MEDLINE
5.VanderWeele T: Explanation in causal inference: methods for mediation and interaction: Oxford University Press 2015 CrossRef MEDLINE PubMed Central
6.Hernán M, Robins J: Causal inference: what If. Boca Raton: Chapman & Hall/CRC 2020.
7. Schipf S, Knüppel S, Hardt J, Stang A: Directed acyclic graphs (DAGs)—Die Anwendung kausaler Graphen in der Epidemiologie. Gesundheitswesen 2011; 73: 888–92 CrossRef MEDLINE
8.Greenland S, Pearl J, Robins JM: Causal diagrams for epidemiologic research. Epidemiology 1999; 10: 37–48 CrossRef
9.Pearl J: Causal diagrams for empirical Research. Biometrika 1995; 82: 669–88 CrossRef
10.Hammer GP, Prel J-Bd, Blettner M: Avoiding bias in observational studies: part 8 in a series of articles on evaluation of scientific publications. Dtsch Arztebl Int 2009; 106: 664–8 VOLLTEXT
11.Schneider A, Hommel G, Blettner M: Linear regression analysis—part 14 of a series on evaluation of scientific publications. Dtsch Arztebl Int 2010; 107: 776–82 VOLLTEXT
12. Boonpor J, Petermann-Rocha F, Parra-Soto S, et al.: Types of diet, obesity, and incident type 2 diabetes: findings from the UK biobank prospective cohort study. Diabetes Obes Metab 2022; 24: 1351–9 CrossRef MEDLINE PubMed Central
13.Textor J, Hardt J, Knüppel S: DAGitty: A graphical tool for analyzing causal diagrams. Epidemiology 2011; 22: 745 CrossRef MEDLINE
14.VanderWeele TJ: A unification of mediation and interaction: a 4-way decomposition. Epidemiology 2014; 25: 749–61 CrossRef MEDLINE PubMed Central
15.Tchetgen Tchetgen EJ: Inverse odds ratio-weighted estimation for causal mediation analysis. Stat Med 2013; 32: 4567–80 CrossRef MEDLINE PubMed Central
16. Imai K, Keele L, Tingley D: A general approach to causal mediation analysis. Psychol Methods 2010; 15: 309–34 CrossRef MEDLINE