Should you adjust for a mediator?
Not when the target is the total effect. A mediator lies on a pathway from treatment to outcome, so adjusting for it blocks part of the effect the total-effect estimate is meant to include.
Try it in the experiment
- Start with adjustment for the risk score and a true total effect of 3.
- Include the intermediate response in the outcome model.
- Remove it and compare both estimates with the total-effect target.
A direct effect is a different estimand, not a repaired total effect. Simply adding a mediator to a regression does not generally identify a direct effect; mediator–outcome confounding and treatment–mediator interactions require additional care.