# How to derive g-computation for a longitudinal experiment from sequential conditional exchangeability?

We have a longitudinal experiment, with interventions $$\bar{A}=\{A_1,A_2,\ldots,A_K\}$$ and outcomes $$\bar{Y}=\{Y_1,Y_2,\ldots,Y_K\}$$. Using some sequential conditional exchangeability assumptions, it should be possible to derive g-computation formula to estimate the causal effect of a treatment strategy $$\bar{a}$$.

Conditional exchangeability commonly assumed for a longitudinal trial are

$$Y_{k'}^{\bar{a}}\ \bot A_k\ |\ {\bar{A}}_{k-1}={\bar{a}}_{k-1},{\bar{Y}}_k$$ for $$k=0,1,\ldots,k'$$

I.e., we need to condition on treatments and observations occurring prior to $$A_k$$.

The resulting g-computation is

$$p({\bar{Y}}^{\bar{a}})\ =\ \prod_{k=1}^{K}{p\left(Y_k\ \middle|\ \bar{Y}_{k-1},\bar{A}_{k-1}\right)}$$

How can this be derived?

I’m able to derive the g-computation, but only if I assume

$$Y_{k\prime}^{\bar{a}}\bot A_k|{\bar{A}}_{k-1}={\bar{a}}_{k-1},{\bar{Y}}_{k'-1}$$ for $$k=0,1,\ldots,k'$$

I.e., condition on treatments occurring prior to $$A_k$$ but observations prior to $$Y_{k'}^{\bar{a}}$$. Thus, condition also on observations that occur after the treatment $$A_k$$ but before the observation $$Y_{k'}$$. Details are written up at https://doi.org/10.6084/m9.figshare.20406687. It remains that I cannot derive the commonly used g-computation from the commonly made sequential conditional exchangeability assumptions, and I would appreciate help.