Install the app

Install this application on your home screen for quick and easy access when you’re on the go.

Just tap Share then “Add to Home Screen”


Install the app

Install this application on your home screen for quick and easy access when you’re on the go.

Just tap Share then “Add to Home Screen”

Advanced Causal Mediation Analysis

Andrew X. Li

Central European University

Andrew is an assistant professor at CEU's Department of International Relations. He obtained his PhD from the National University of Singapore and King’s College London.

His research interests include international political economy, research design, and quantitative methods. He teaches the Research Design and Methods in IR course series at CEU.

Twitter @lixiang577

Course Dates and Times

Monday 6 August - Friday 10 August

14:00-15:30 / 16:00-17:30

Prerequisite Knowledge

This course builds on and makes use of several fields and techniques in social science methodology. Students should possess basic knowledge and skills in some – if not all – of the following areas: 1) causal inference and Rubin causal framework; 2) experimental methods; 3) regression analysis (and preferably structural equation modeling), 4) instrumental variable method, 5) Bayesian statistics and 6) basic skills in R.

Students are not discouraged from signing up for this course if they do not fully meet the above criteria. However, they are strongly encouraged to take the relevant courses offered by the Summer School before or concurrently with this course. Given that this is an advanced level course, the instructor may adjust the content depending on the general background of the participants.

Short Outline

This course introduces students to the concepts and techniques that help empirical researchers to unpack the black box of causality and formally evaluate the process in which a causal variable of interest influences an outcome. The course begins with an introduction of the concepts related to causal inference and causal mediation analysis, such as potential outcome and average causal mediation effect (ACME). It then moves on with research designs for identifying causal mediation effect in both experimental and observation studies, such as parallel design, crossover design and designs that exploit instrumental variables and interaction terms. Students will learn to use the “mediation” package in R to carry out mediation analysis. The last day of the course is devoted to student presentations whereby students will present their research or research proposals and receive feedbacks from the instructor and their peers. Thus, students are encouraged to bring their own data to the course.

Tasks for ECTS Credits

  • Participants attending the course: 2 credits (pass/fail grade) The workload for the calculation of ECTS credits is based on the assumption that students attend classes and carry out the necessary reading and/or other work prior to, and after, classes.
  • Participants attending the course and completing one task (see below): 3 credits (to be graded)
  • Participants attending the course, and completing two tasks (see below): 4 credits (to be graded)

To receive 2 credits, participants will have taken part actively in the course and given a presentation on the last day of the course.

To receive 3 credits participants will complete and submit a replication/extension exercise in R using the "mediation" package.

For a fourth credit, participants will be required, in addition to the above, submit in writing a research paper or research proposal (2500-3000 words) that employs causal mediation analysis as part of the research design.

Long Course Outline

Causal mechanism is a fundamental component of social science theories. Social scientists are not only interested in whether one variable causally affects another, but also how such a causal relationship arises. However, most of the existing empirical strategies aim at merely establishing causal effects between variables, resulting in a “black box” approach to causality. This course introduces students to the concepts and techniques that help empirical researchers to unpack the black box of causality and formally evaluate the process in which a causal variable of interest influences an outcome.

On the first day, the class will begin with an introduction to causal inference under the Rubin causal framework, or potential outcome framework. Students are introduced to concepts such as potential outcome and average treatment effect (ATE) that are necessary to understand causal mediation. With these foundations, we will then conceptualize causal mechanism as a decomposition of the causal effect into a direct effect and an indirect effect, or causal mediation effect (ACME). We then move on with the assumptions required for the identification of ACME. This is the most crucial part of causal mediation analysis as the validity of estimation by and large depends on the extent to which the assumptions hold. For that, we introduce the idea of sensitivity analysis, which allows us to evaluate the robustness of the results to potential violations of the identification assumptions. As you can see, Day 1 is filled with theoretical and conceptual discussions on causal mediation.

What then are the methods used to identify causal mediation effect? Day 2 introduces the experimental approach to mediation analysis. After Day 1’s lesson, you will understand that both the treatment and the mediator variables need to be randomized for the mediation effect to be identified. Thus, Day 2’s lesson introduces several experimental designs that help researchers identify mediation effect. Compared with the conventional experimental design, the key difference here is that the experimentalist needs to manipulate both the treatment and the mediator. Some of the designs require perfect mediator and others can be used even with imperfect manipulation. Examples of social science experiments are used to illustrate the key ideas that underlie each of the designs.

Day 3’s lesson focuses on mediation analysis using observational data. As you will see, observational data differs from experimental data in that the data generating process is not randomized for the former. Therefore, the researcher can manipulate neither the treatment nor the mediator in observational studies. The most important message of Day 3’s lesson is that observational studies should use experimental designs introduced in Day 2 as templates. We will see, for example, how the cross-over (experimental) design can be extended and applied to observational studies. Other strategies that exploit instrumental variables and interaction terms will also be introduced.

Day 4’s lesson has two parts. The first part looks a little bit into the technical aspect of estimation. We will study the structural equation framework and the Baron-Kenny procedure in establishing causal mediation. We will see that a major limitation of the linear structural equation model is that it cannot be directly applied to mediators and outcomes that are measured with discrete variables. Against this background, students are introduced to a newly developed general algorithm that can be applied to any type of data. The second part is a practical session whereby students will learn to use the “mediation” package in R. Students may carry out causal mediation analysis with their own data.

On the last day, students will present their research or research proposals that employ causal mediation analysis. Students will receive feedbacks from the instructor and their peers on their research design and data analysis, if any.

Day Topic Details
2 Experimental designs for mediation analysis

3 hour lecture

1 Intoduction to causal mediation analysis Key concepts, assumptions and implications

2 x 90min lecture

3 Mediation analysis in observational studies

3 hour lecture

4 Linear structural equation framework and algorithm ”mediation” package in R

90 min lecture, 90 min lab

5 Student presentations

3 hours, seminar

Day Readings

Imai, Kosuke, Luke Keele, Dustin Tingley, and Teppei Yamamoto. "Unpacking the black box of causality: Learning about causal mechanisms from experimental and observational studies." American Political Science Review 105, no. 4 (2011): 765-789.

Holland, Paul W. "Statistics and Causal Inference." Journal of the American Statistical Association 81, no. 396 (1986): 945-960.

Rubin, Donald B. "Estimating causal effects of treatments in randomized and nonrandomized studies." Journal of educational Psychology 66, no. 5 (1974): 688-701


Imai, Kosuke, Dustin Tingley, and Teppei Yamamoto. "Experimental designs for identifying causal mechanisms." Journal of the Royal Statistical Society: Series A (Statistics in Society) 176, no. 1 (2013): 5-51.

Bullock, John G., and Shang E. Ha. "Mediation Analysis Is Harder than It Looks." In Druckman, James N., et al., eds. Cambridge Handbook of Experimental Political Science. Cambridge University Press, (2011): 508-521.


Baron, Reuben M., and David A. Kenny. "The moderator–mediator variable distinction in social psychological research: Conceptual, strategic, and statistical considerations." Journal of Personality and Social Psychology 51, no. 6 (1986): 1173-1182.

MacKinnon, David Peter. Introduction to Statistical Mediation Analysis. Routledge, (2008). Chapter 10, 275-296.

Yuan, Ying, and David P. MacKinnon. "Bayesian mediation analysis." Psychological Methods 14, no. 4 (2009): 301-322.


MacKinnon, David Peter. Introduction to Statistical Mediation Analysis. Routledge, (2008). Chapter 3-4, 47-102.

Imai, Kosuke, Luke Keele, and Dustin Tingley. "A general approach to causal mediation analysis." Psychological Methods 15, no. 4 (2010): 309-334.

Tingley, Dustin, Teppei Yamamoto, Kentaro Hirose, Luke Keele, and Kosuke Imai. "mediation: R Package for Causal Mediation Analysis." Journal of Statistical Software 59, no. 5 (2014).


No required readings

Software Requirements

R (version 3.4.3 or newer).

Hardware Requirements

Participants are required to bring their own laptops.

Since R is an open-source and free software, students can install it on their laptops and bring the laptops to class for the practical (lab) session. R is able to run on machines that meet the following requirements:

Windows PC: machines that run on 64-bit Windows 7, Windows Server 2008 and Windows 10.

Mac: 64-bit Intel-based Macs, that is any machine made since mid 2008.

Recommended Courses to Cover Before this One

<p><strong>Summer School</strong></p> <p>R Basics</p> <p>Causal Inference in the Social Sciences I &amp; II</p>

Additional Information


This course description may be subject to subsequent adaptations (e.g. taking into account new developments in the field, participant demands, group size, etc). Registered participants will be informed at the time of change.

By registering for this course, you confirm that you possess the knowledge required to follow it. The instructor will not teach these prerequisite items. If in doubt, please contact us before registering.