Mediation on the Ides of March

1:08 AM, March 28, 2025

Good morning, good evening, hello to all my avid readers (there aren’t any, my blog only seems to be perused by Russian web-crawlers attempting to leave malicious links in the comments section). It’s been awhile, I know, but now I have returned from my extended hiatus from writing this blog. A lot of life has happened since I last wrote. I did in fact begin the reading course with the professor (Ashkan) that I had wanted to work with in the fall, and I’m learning a lot about mediation analysis, which I am posting about today. We decided that this would be a suitable topic after some discussion, even though in earlier blog posts I’ve alluded to learning about Dynamic Treatment Regimes. My girlfriend, Olivia, who I’ve been dating almost two years now, and who was mentioned in the blog post about thanksgiving games (and probably at least one other post), split up with me. We broke up on the Ides of March though, so it’s some consolation that, at the very least, I have as company Julius Caesar in receipt of a backstabbing on that particular date. Beware the Ides! I say this mostly in jest. Our parting ways was necessary, I suppose, in spite of the pain that it brought me. But you Russian web-crawlers aren’t here for my tears, you’re here to learn about the mysteries of Mediation analysis in Causal inference.

Mediation analysis is essentially concerned with breaking down a treatment effect, or ATE, \mathbb{E} [Y(1) - Y(0)], into a ‘direct-effect’ and an ‘indirect-effect’, the indirect effect travels through a mediator M, and the direct effect does not. Note that Y(1) and Y(0) are ‘potential outcomes’, utilizing the potential outcomes framework proposed by Rubin. For example, suppose some new drug decreases risk of heart disease, and also decreases blood pressure. It’s also known decreased blood pressure decreases risk of heart disease. The question: does the new drug decrease risk heart disease ONLY by decreasing blood pressure which decreases risk of heart disease, or does the new drug also have a significant effect on heart disease unrelated to the decrease in blood pressure. The typical causal diagram looks something like this:

Sorry that it’s obnoxiously large, for whatever reason latex on blog-post had trouble doing a tikzpicture. D is treatment, conditional on other covariates X, we want to know the effect of D on M on Y and the effect directly on Y. When we have simple linear models for everything, for example if there is only one mediator, we can get these effects quite easily through simple algebra and linear regression. Note, however, that our mediation analysis cannot be done by simply randomizing M, because randomizing M would cut off the path from D to M (because M is randomized it won’t be affected by anything, including D), so we can only randomize D, not D and M. Thus, mediation analysis is always requires ‘causal’ inference techniques, because it always involves counterfactuals on things we can’t just randomize to make the confounders disappear.

First, let us define direct and indirect effects, in terms of expectation, as

    \[\mathbb{E}[Y(1) - Y(0)] = \mathbb{E}[Y(1, M(1)) - Y(0, M(0))] = \mathbb{E}[Y(1, M(1)) - Y(0, M(1))] + \mathbb{E}[Y(0, M(1)) - Y(0, M(0))]\]

The first term is the direct effect (mediator held fixed) and the second term is the indirect effect (mediator changed). This definition of direct and indirect effect is clear, but sometimes, in more complicated circumstances (multiple mediators, multiple time points, etc) the definition is more loose. For example, sometimes the ‘randomized direct’ and ‘randomized indirect’ effects are used, which replaces M(1) in Y(0, M(1)) with a ‘random draw’ of M(1) from the distribution of M(1)s, instead of that specific individuals M(1). I might talk about this more in subsequent blog posts. When we have linear models for everything though, our life is simple:

    \[\begin{itemize}\item Pose linear models:\item $Y = \beta D + \gamma M + \rho_1 X + \epsilon_1$\item $M = \alpha D + \rho_2 X + \epsilon_2$\item $D = \rho_3 + \epsilon_3$\item $\mathbb{E}[\epsilon_j] = 0$, $j = 1, 2, 3$\item Thus: $Y = \beta D + \gamma (\alpha D + \rho_2 X + \epsilon_2) + \rho_1 X + \epsilon_1$\item The direct effect is $\beta$, the indirect effect is $\gamma \alpha$\item Everything estimated with ordinary linear regression\end{itemize}\]

I think I’ll leave this blog post here in terms of the math, but this is just the absolute tip of the iceberg of Mediation analysis. Lately I’ve been working with Ashkan on a simulation of a method used by Vansteelandt that does mediation analysis in the survival setting with multiple time points, and we potentially will use this method on some real data, and I also have been learning about semi-parametrics and efficient influence functions. UPSTAT, the local Rochester statistics conference, is in a few weeks, and I’m working on a set of three presentations (a section) with my old professor Teresa Gibson from RIT, where we’ll do three tutorials, each 1 hour. One will be just me, talking about mediation, one will be mostly her talking about common causal methods (and a little bit of me talking about Propensity Score Matching), and the other will be split about evenly, I’ll spend the first part talking about efficient influence functions, and then she’ll talk about TMLE and the Super Learner. The breakup, and the spot of illness that followed, really took me out for a couple of weeks, so I’ve got a lot of catching up to do. In future blog posts I hope to talk more about mediation with multiple mediators, discuss some other papers I’ve read on the subject, and to discuss the longitudinal setting and implementing the algorithm proposed by Vansteelandt.

I’m also still working with Sally Thurston on the Seychelles project, but the grant renewal is a bit unclear at the moment with what’s going on in the government with NIH funding, so I’ll be presenting what I have so far for that project next month to… someone? I’m not sure of the details, but I’ll meet with Sally and discuss it soon. Fingers crossed that the grant renewal goes through. It’s been renewed for over two decades, so it’d be a shame if we lost it. In terms of the project itself, Sally and I met with collaborators to discuss the analysis plan and preliminary analyses in which I advocated certain outcomes be used as ‘the’ outcomes for our effect of Methylmercury longitudinal study, based on their correlation with other measures… I won’t go into details, but the point is we’re kind of waiting to hear back from collaborators who know more about what the outcomes in question actually measure cognitively before I go ahead and run a REML longitudinal analysis and can begin writing a paper on the subject. But that project is going well.

I’ve also gotten back into chess lately, probably in order to distract myself from my knawing loneliness and the general nervous uncertainty that’s cropped up inside about who I am and what my future holds, so perhaps some future blog posts might include chess related content as well.

Leave a Comment

Your email address will not be published. Required fields are marked *