The ratio-of-mediator-probability weighting (RMPW) method, a propensity score-based weighting strategy developed by Hong and others (Bein et al, 2018; Hong, 2010b, 2015; Hong, Deutsch, & Hill, 2011, 2015; Hong & Nomi, 2012; Huber, 2014; Lange, Vansteelandt, & Bekaert, 2012; Lange, Rasmussen, & Thygesen, 2014; Tchetgen Tchetgen & Shpister, 2012),  decomposes the total effect of a treatment into an “indirect effect” transmitted through a specific mediator and a “direct effect” representing unspecified mechanisms. The basic theoretical rationale of RMPW is that, among individuals with the same pretreatment characteristics, the distribution of the mediator in the experimental group and that in the control group can be effectively equated through weighting. Transforming mediator distributions through weighting makes possible the estimation of population average counterfactual outcomes essential to treatment effect decomposition. RMPW estimates simple mean contrasts between the potential outcomes and reduces confounding conveniently through weighting. Hence it does not require specifying the functional form of an outcome model.

This weighting method was advocated to epidemiologists as “a simple unified approach for estimating natural direct and indirect effects” (Lange, Vansteelandt, & Bekaert, 2012). The method applies regardless of the distribution of the outcome, the distribution of the mediator, or the functional relationship between the outcome and the mediator. Moreover, the RMPW method can easily accommodate data in which the mediator effect on the outcome may depend on the treatment assignment (Hong, 2010b). This is the case when a treatment produces its effects not only through changing the mediator value but also in part by altering the mediational process that normally produces the outcome (Judd & Kenny, 1981). One may use RMPW to further investigate whether the mediation mechanism varies across subpopulations and to disentangle complex mediation mechanisms involving multiple concurrent or consecutive mediators. A combination of RMPW with MMWS or IPTW enables researchers to conduct mediation analysis when the treatment is not randomized. We have additionally developed a weighting-based approach to sensitivity analysis for assessing the consequences in the presence of hidden bias (Hong, Qin, & Yang, 2018).

In multisite randomized trials or multisite natural experiments, treatment impacts often vary across the experimental sites due to differences in participant composition, in treatment-control contrast, or in other contextual factors. To unpack the heterogeneity in the total treatment impacts, we extend RMPW to investigations of heterogeneous mediation mechanisms across experimental sites (Qin & Hong, 2017; Qin, Hong, Deutsch, & Bein, 2019).


“rmpw” module in Stata: https://ideas.repec.org/c/boc/bocode/s458301.html

“rmpw” package in R: https://cran.r‐project.org/web/packages/rmpw/index.html

“multisitermpw” package in R: https://cran.r‐project.org/web/packages/MultisiteMediation/index.html

Download RMPW Users Manual for a free stand-alone RMPW program for analyzing a binary treatment and a binary mediator. The stand-alone software has the following features:

− Import Stata or SPSS data file
− Multiple imputation of missing data
− Initial screening of multicollinearity
− Variable selection for the propensity score model under each treatment condition
− Determine common support with or without a caliper
− Parametric RMPW analysis
− Nonparametric RMPW analysis
− Balance checking
− Two different sets of decomposition

Additional feature of the Stata module and the R packages: Two-step estimation accounting for estimation uncertainty in propensity score analysis and outcome analysis

RMPW Workshop Materials: This web site provides the Stata, SAS, and R code that Hong and her colleagues have prepared for workshops and graduate courses.

RMPW workshop offered at Stanford University in July 2016 (on youtube):

Part I. Concepts of causal mediation

Part II. Rationale of weighting methods for causal mediation analysis strategy

Part III. Parametric and nonparametric analytic procedures and simulation results

Part IV. Multisite causal mediation analysis


Hong, G.*, Yang, F.*, & Qin, X. (2023). Posttreatment confounding in causal mediation studies: A cutting-edge problem and a novel solution via sensitivity analysis. Biometrics, 79, 1042-1056. (* equal first-authors)

Qin, X., Deutsch, J., Hong, G. (2021). Revealing heterogeneity in complex mediation mechanisms: Two concurrent mediators. Journal of Policy Analysis and Management, 40(1), 158-190.

Qin, X., Hong, G., Deutsch, J., & Bein, E. (2019). Multisite causal mediation analysis in the presence of complex sample and survey designs and non-random nonresponse. Journal of the Royal Statistical Society, Series A, 182, Part 4, 1343-1370.

Hong, G., Qin, X., & Yang, F. (2018). Weighting-based sensitivity analysis in causal mediation studies. Journal of Educational and Behavioral Statistics, 43(1), 32-56.

Bein, E., Deutsch, J., Hong, G. Porter, K., Qin, X., & Yang, C. (2018). Two-step estimation in RMPW analysis. Statistics in Medicine, 37(8), 1304-1324.

Qin, X., & Hong, G. (2017). A weighting method for assessing between-site heterogeneity in causal mediation mechanism. Journal of Educational and Behavioral Statistics, 42(4), 491-495.

Hong, G. (2010). Ratio of mediator probability weighting for estimating natural direct and indirect effects. In JSM Proceedings, Biometrics Section. Alexandria, VA: American Statistical Association, pp.2401-2415.

Hong, G. (2015). Causality in a social world: Moderation, mediation, and spill-over. West Sussex, UK: John Wiley & Sons, Inc.

Hong, G., Deutsch, J., & Hill, H. (2011). Parametric and non-parametric weighting methods for estimating mediation effects: An application to the National Evaluation of Welfare-to-Work Strategies. In JSM Proceedings, Social Statistics Section. Alexandria, VA: American Statistical Association, pp.3215-3229. (Supplementary Tables)

Hong, G., Deutsch, J., & Hill, H. D. (2015). Ratio-of-mediator-probability weighting for causal mediation analysis in the presence of treatment-by-mediator interaction. Journal of Educational and Behavioral Statistics, 40(3), 307-340.

Hong, G., & Nomi, T. (2012). Weighting methods for assessing policy effects mediated by peer change. Journal of Research on Educational Effectiveness, special issue on the statistical approaches to studying mediator effects in education research, 5(3), 261-289.

Huber, M. (2014). Identifying causal mechanisms (primarily) based on inverse probability weighting. Journal of Applied Econometrics, 29(6), 920-943.

Lange, T., Vansteelandt, S., & Bekaert, M. (2012). A simple unified approach for estimating natural direct and indirect effects. American Journal of Epidemiology, 176(3), 190-195.

Lange, T., Rasmussen, M., & Thygesen, L. C. (2014). Assessing natural direct and indirect effects through multiple pathways. American Journal of Epidemiology, 179, 513-518.

Qin, X., & Hong, G. (2016). Analyzing heterogeneous causal mediation effects in multi-site trials with application to the National Job Corps Study. In JSM Proceedings, Survey Research Methods Section. Alexandria, VA: American Statistical Association. pp.910-938.
(* Winner of JSM 2016 Student Paper Competition)

Tchetgen Tchetgen, E. J. & Shpitser, I. (2012). Semiparametric theory for causal mediation analysis: Efficiency bounds, multiple robustness and sensitivity analysis. The Annals of Statistics, 40(3), 1816-1845.