This repository contains various versions of an R function to estimate interventional mediation effects that emulate a target RCT, as per the following paper:
Moreno-Betancur M, Moran P, Becker D, Patton GC, Carlin JB. "Mediation effects that emulate a target randomised trial: Simulation-based evaluation of ill-defined interventions on multiple mediators". Statistical Methods in Medical Research 2021 (Epub ahead of print March 20, 2021). doi:10.1177/0962280221998409 (open access)
The most recent and up to date version from here on is medRCT() in the file medRCT.R