Let AA be a binary treatment, YY be an outcome and MM be a mediator, a variable on a directed path from AA to Y.Y. The potential mediator M(a)M(a) is the value of the mediator under treatment a,a, and the nested potential outcome Y(a,m)Y(a,m) is the value of the outcome under treatment aa with the mediator set to m.m. Consistency states that M=M(A)M=M(A) and Y=Y(A,M(A))=Y(A).Y=Y(A,M(A))=Y(A). The cross-world potential outcome Y(a,M(a′))Y(a,M(a')) is the outcome under treatment aa with the mediator at the value it would take under treatment a′.a'.

Let AA be a treatment, MM be a mediator and YY be an outcome. The total effect of AA on YY is the average treatment effect, which decomposes into effects through and not through the mediator.

τ:=E[Y(1,M(1))−Y(0,M(0))]\tau:=\mathbb{E}\left[Y(1,M(1))-Y(0,M(0))\right]

Let AA be a treatment, MM be a mediator and mm be a fixed value. The controlled direct effect at mm is the effect of the treatment when the mediator is held fixed at mm for every unit.

CDE(m):=E[Y(1,m)−Y(0,m)]\mathrm{CDE}\left(m\right):=\mathbb{E}\left[Y(1,m)-Y(0,m)\right]

Let AA be a treatment and MM be a mediator. The natural direct effect is the effect of changing the treatment while holding the mediator at the value it would take under control for each unit.

NDE:=E[Y(1,M(0))−Y(0,M(0))]\mathrm{NDE}:=\mathbb{E}\left[Y(1,M(0))-Y(0,M(0))\right]

Let AA be a treatment and MM be a mediator. The natural indirect effect is the effect of changing the mediator from its control value to its treated value while holding the treatment at treated for each unit.

NIE:=E[Y(1,M(1))−Y(1,M(0))]\mathrm{NIE}:=\mathbb{E}\left[Y(1,M(1))-Y(1,M(0))\right]

The natural effects have the following properties:

  • the total effect is the sum of the natural direct and indirect effects, τ=NDE+NIE,\tau=\mathrm{NDE}+\mathrm{NIE}, without any assumption about interaction between AA and M;M;
  • the controlled direct effect depends on mm when the treatment and mediator interact, and equals the natural direct effect when they do not;
  • natural effects involve cross-world potential outcomes, which are never observed for any unit, so their identification requires assumptions that cannot be verified even by a randomised experiment.

Let AA be a treatment, MM be a mediator, YY be an outcome and X‾\underline{X} be pre-treatment covariates. Sequential ignorability is the conjunction of the following assumptions:

  • no unmeasured treatment-outcome confounding: Y(a,m)⊥ ⁣ ⁣ ⁣⊥A∣X‾;Y(a,m)\perp\!\!\!\perp A\mid\underline{X};
  • no unmeasured mediator-outcome confounding: Y(a,m)⊥ ⁣ ⁣ ⁣⊥M∣A,X‾;Y(a,m)\perp\!\!\!\perp M\mid A,\underline{X};
  • no unmeasured treatment-mediator confounding: M(a)⊥ ⁣ ⁣ ⁣⊥A∣X‾;M(a)\perp\!\!\!\perp A\mid\underline{X};
  • no mediator-outcome confounder affected by treatment: Y(a,m)⊥ ⁣ ⁣ ⁣⊥M(a′)∣X‾.Y(a,m)\perp\!\!\!\perp M(a')\mid\underline{X}.

Let sequential ignorability, consistency and positivity hold. The mediation formula states that the mean cross-world potential outcome is identified by averaging the outcome regression over the mediator distribution under the other treatment.

E[Y(a,M(a′))]=∫∫E[Y∣A=a,M=m,X‾=x‾]p(m∣A=a′,X‾=x‾)p(x‾)dm dx‾\mathbb{E}\left[Y(a,M(a'))\right]=\int\int\mathbb{E}\left[Y\mid A=a,M=m,\underline{X}=\underline{x}\right]p\left(m\mid A=a',\underline{X}=\underline{x}\right)p\left(\underline{x}\right)dm\,d\underline{x}

The natural direct and indirect effects follow by substituting (a,a′)=(1,0),(0,0)\left(a,a'\right)=\left(1,0\right),\left(0,0\right) and (1,1),(1,0).\left(1,1\right),\left(1,0\right). For linear models E[M∣a,x‾]=α0+α1a+α‾2⊺x‾\mathbb{E}\left[M\mid a,\underline{x}\right]=\alpha_0+\alpha_1a+\underline{\alpha}_2^\intercal\underline{x} and E[Y∣a,m,x‾]=β0+β1a+β2m+β‾3⊺x‾\mathbb{E}\left[Y\mid a,m,\underline{x}\right]=\beta_0+\beta_1a+\beta_2m+\underline{\beta}_3^\intercal\underline{x} without interaction, the natural indirect effect is the product α1β2\alpha_1\beta_2 and the natural direct effect is β1.\beta_1.

Let k=0,1,…,Kk=0,1,\ldots,K index time points. A time-varying treatment is a sequence A0,A1,…,AKA_0,A_1,\ldots,A_K of treatments, one at each time point. The treatment history up to time kk is Aˉk:=(A0,…,Ak)\bar{A}_k:=\left(A_0,\ldots,A_k\right) and a treatment regime or strategy is a fixed sequence aˉ=(a0,…,aK).\bar{a}=\left(a_0,\ldots,a_K\right).

Let AˉK\bar{A}_K be a time-varying treatment and L0,L1,…,LKL_0,L_1,\ldots,L_K be time-varying covariates measured at each time point before the treatment at that time point, with history Lˉk:=(L0,…,Lk).\bar{L}_k:=\left(L_0,\ldots,L_k\right). The potential outcome Y(aˉ)Y\left(\bar{a}\right) is the outcome at the end of follow-up under the treatment regime aˉ.\bar{a}.

Let AˉK\bar{A}_K be a time-varying treatment with time-varying covariates LˉK.\bar{L}_K. Treatment-confounder feedback is the situation in which a covariate LkL_k is affected by earlier treatments Aˉk−1\bar{A}_{k-1} and also affects later treatments AkA_k and the outcome. Under treatment-confounder feedback the covariate is both a confounder of later treatment and a mediator of earlier treatment, so adjusting for it in a regression blocks part of the effect of earlier treatment and conditions on a collider, whereas not adjusting for it leaves later treatment confounded. Standard regression adjustment is therefore biased, and the g-methods below are required.

Let AˉK\bar{A}_K be a time-varying treatment with time-varying covariates LˉK.\bar{L}_K. Sequential exchangeability is the assumption that at each time point the treatment is independent of the potential outcomes given the treatment and covariate histories.

Y(aˉ)⊥ ⁣ ⁣ ⁣⊥Ak∣Aˉk−1=aˉk−1,Lˉk  ∀ k,aˉY\left(\bar{a}\right)\perp\!\!\!\perp A_k\mid\bar{A}_{k-1}=\bar{a}_{k-1},\bar{L}_k\,\,\forall\,k,\bar{a}

Sequential positivity is the assumption that P(Ak=ak∣Aˉk−1=aˉk−1,Lˉk=lˉk)>0\mathbb{P}\left(A_k=a_k\mid\bar{A}_{k-1}=\bar{a}_{k-1},\bar{L}_k=\bar{l}_k\right)>0 for every history that occurs, and sequential consistency is the assumption that Y=Y(AˉK).Y=Y\left(\bar{A}_K\right).

Let sequential exchangeability, positivity and consistency hold. The g-formula states that the mean potential outcome under a regime is identified by averaging the outcome regression over the covariate distribution that would arise under the regime, in which each covariate is drawn given the past covariates and the regime’s past treatments.

E[Y(aˉ)]=∫E[Y∣AˉK=aˉ,LˉK=lˉK]∏k=0Kp(lk∣Aˉk−1=aˉk−1,Lˉk−1=lˉk−1)dlˉK\mathbb{E}\left[Y\left(\bar{a}\right)\right]=\int\mathbb{E}\left[Y\mid\bar{A}_K=\bar{a},\bar{L}_K=\bar{l}_K\right]\prod_{k=0}^Kp\left(l_k\mid\bar{A}_{k-1}=\bar{a}_{k-1},\bar{L}_{k-1}=\bar{l}_{k-1}\right)d\bar{l}_K

The g-formula reduces to the adjustment formula when K=0,K=0, and it is the truncated factorisation of the causal graph with the treatment factors removed.

Let the conditional distributions in the g-formula be given parametric models. The parametric g-formula is the method that fits these models, simulates covariate histories under the regime of interest from the fitted covariate models and averages the fitted outcome model over the simulated histories. The parametric g-formula has the following properties:

  • it estimates the mean outcome under any regime, including dynamic regimes in which aka_k depends on lˉk;\bar{l}_k;
  • it requires a correct model for every covariate at every time point, and misspecification accumulates over time;
  • under the null hypothesis of no treatment effect the fitted models can still imply a non-zero effect, which is the g-null paradox.

Let AˉK\bar{A}_K be a time-varying treatment and gg be a function with parameter β‾.\underline{\beta}. A marginal structural model (MSM) is a model for the mean potential outcome as a function of the regime.

E[Y(aˉ)]=g(aˉ; β‾)\mathbb{E}\left[Y\left(\bar{a}\right)\right]=g\left(\bar{a};\,\underline{\beta}\right)

For example, g(aˉ; β‾)=β0+β1∑k=0Kakg\left(\bar{a};\,\underline{\beta}\right)=\beta_0+\beta_1\sum_{k=0}^Ka_k models a linear effect of the cumulative treatment. The model is marginal because it does not condition on the time-varying covariates, and structural because it is a model for potential outcomes.

Let AˉK\bar{A}_K be a time-varying treatment with time-varying covariates LˉK.\bar{L}_K. The inverse probability of treatment weight of a unit is the reciprocal of the probability of its observed treatment history given its covariate history, computed as a product over time points.

W:=∏k=0K1P(Ak∣Aˉk−1,Lˉk)W:=\prod_{k=0}^K\frac{1}{\mathbb{P}\left(A_k\mid\bar{A}_{k-1},\bar{L}_k\right)}

The stabilised weight replaces each numerator by P(Ak∣Aˉk−1),\mathbb{P}\left(A_k\mid\bar{A}_{k-1}\right), which has mean one and reduces the variance.

Let E[Y(aˉ)]=g(aˉ; β‾)\mathbb{E}\left[Y\left(\bar{a}\right)\right]=g\left(\bar{a};\,\underline{\beta}\right) be a marginal structural model and WW be the inverse probability of treatment weights. Inverse probability of treatment weighting (IPTW) is the method that estimates β‾\underline{\beta} by fitting the model E[Y∣AˉK=aˉ]=g(aˉ; β‾)\mathbb{E}\left[Y\mid\bar{A}_K=\bar{a}\right]=g\left(\bar{a};\,\underline{\beta}\right) to the observed data with each unit weighted by W.W. Inverse probability of treatment weighting has the following properties:

  • under sequential exchangeability, positivity and consistency the weighted population is a pseudo-population in which the treatment at each time point is independent of the covariate history, so the weighted association is the causal effect;
  • it requires a correct model for the treatment at each time point but no model for the covariates or the outcome given the covariates;
  • it is unstable when some weights are large, which occurs when some treatment histories are nearly deterministic given the covariates;
  • it extends to censoring by multiplying by inverse probability of censoring weights.

Let AˉK\bar{A}_K be a time-varying treatment, 0ˉ\bar{0} denote no treatment after time kk and γ\gamma be a function with parameter ψ‾\underline{\psi} and γ(⋅; 0‾)=0.\gamma\left(\cdot;\,\underline{0}\right)=0. A structural nested mean model (SNMM) is a model for the effect of the treatment at time k,k, with no treatment thereafter, given the history up to time k.k.

E[Y(aˉk,0ˉ)−Y(aˉk−1,0,0ˉ)∣Aˉk=aˉk,Lˉk=lˉk]=γ(aˉk,lˉk; ψ‾)\mathbb{E}\left[Y\left(\bar{a}_k,\bar{0}\right)-Y\left(\bar{a}_{k-1},0,\bar{0}\right)\mid\bar{A}_k=\bar{a}_k,\bar{L}_k=\bar{l}_k\right]=\gamma\left(\bar{a}_k,\bar{l}_k;\,\underline{\psi}\right)

The model is nested because it specifies the effect of each treatment one time point at a time, and it allows the effect at time kk to depend on the covariate history.

Let γ(⋅; ψ‾)\gamma\left(\cdot;\,\underline{\psi}\right) be a structural nested mean model. The g-estimation method defines, for each candidate ψ‾,\underline{\psi}, the transformed outcome that removes the modelled effect of all treatments from time kk onwards,

Hk(ψ‾):=Y−∑j=kKγ(Aˉj,Lˉj; ψ‾),H_k\left(\underline{\psi}\right):=Y-\sum_{j=k}^K\gamma\left(\bar{A}_j,\bar{L}_j;\,\underline{\psi}\right),

and estimates ψ‾\underline{\psi} as the value at which Hk(ψ‾)H_k\left(\underline{\psi}\right) is independent of AkA_k given (Aˉk−1,Lˉk)\left(\bar{A}_{k-1},\bar{L}_k\right) for every k,k, which under sequential exchangeability holds at the true value since Hk(ψ‾)H_k\left(\underline{\psi}\right) then has the mean of Y(Aˉk−1,0ˉ).Y\left(\bar{A}_{k-1},\bar{0}\right). In practice ψ‾\underline{\psi} solves the estimating equation that sets to zero the sample covariance between Hk(ψ‾)H_k\left(\underline{\psi}\right) and the residual Ak−P(Ak=1∣Aˉk−1,Lˉk).A_k-\mathbb{P}\left(A_k=1\mid\bar{A}_{k-1},\bar{L}_k\right). G-estimation has the following properties:

  • it requires a model for the treatment at each time point and the structural nested mean model but no model for the outcome given the covariates;
  • it is doubly robust when an outcome model is added to the estimating equation;
  • it does not suffer from the g-null paradox and is less sensitive to large weights than inverse probability of treatment weighting;
  • it estimates effect modification by the covariate history, which marginal structural models cannot.