# What is the difference between the G-formula, G-estmation, G-computation and G-methods

I've seen a similar questions posted but I wasn't sure on the answers that were provided. Similar to when I try and look these methods up, I've seen more general abstract descriptions that were hard to understand.

I think I've read that G-method is just a general term for a model that estimates ATE and so encompases the G-formula, G-estimation and G-computation and also methods such as propensity scores and inverse weighting. If that is the case, what is the method in G-formula, G-estimation and G-computation?

Additionally, I also see structural models and structural nested mean models quite a lot. Are these the same as G-methods in that they aren't actualy methods, just conceptulisations of types of causal models?

Any help would be really appreciated, thanks

G-methods: the collection of 'general' methods for dealing with time-varying confounding developed by James Robins. These include g-formula, inverse probability weighting of marginal structural models, augmented inverse probability weighting, and g-estimation of structural nested models.

To help define the remainder of the terms, I am going to define some notation. Let $$Y_i^a$$ be the potential outcome under action $$a$$ (the outcome person $$i$$ would have if they did $$a$$), $$Y$$ be the observed outcome, $$A$$ be the observed action taken, and $$W$$ be a set of covariates deemed to be confounding variables. Finally, let $$V$$ be a single variable from $$W$$. For simplicity, I will only talk about the outcome at a single time, but everything here generalizes to multiple times (i.e., settings with time-varying confounding).

G-formula: The approach used to express $$E[Y^a]$$ in terms of the observed data by an outcome process. In this setting, the g-formula is $$E[Y^a] = \sum_{w} E[Y | A=a, W=w] \Pr(W=w)$$ Here, we have written the unobservable quantity we want to estimate (the marginal mean of the potential outcomes, which we can't see) in terms of $$W,A,Y$$ (observables). The g-formula relies on modeling the outcome process (i.e., $$Y$$ as a function of $$A,W$$) but it does not tell us how to do this.

G-computation: G-computation can be thought of as the algorithm to practically implement the g-formula. It says to fit some model for $$Y$$ given $$A,W$$ then using that model predict everyone's outcomes if their $$A=a$$, and then take the mean of those predicted potential outcomes. G-formula and g-computation are often used interchangeably in the literature, so something to be wary of.

G-estimation: G-estimation is a separate method. More formally it is 'g-estimation of structural nested models'. So, we need to talk about structural nested models first.

Structural nested models (SNM): SNM are outcome models meant to handle time-varying effect measure modification (something that is technically difficult to define). But they are pretty straightforward in the single time-point setting. The following is an additive SNM: $$E[Y^a | A=a, V] - E[Y^0 | A=a, V] = \alpha_1 a + \alpha_2 a V$$ This model has two parameters, the effect of $$a$$ when $$V=0$$ and the effect of $$a$$ when $$V=1$$ (if $$V$$ is binary). So, the structural nested model is a model we might assume for how the additive effect of $$A$$ on $$Y$$ varies by $$V$$.

Now back to g-estimation. G-estimation is the process we use to estimate the parameters ($$\alpha_1,\alpha_2$$) of the SNM. It is important to note that the estimand, or parameter of interest, varies between g-formula and g-estimation. Therefore, they should not be confused with each other.

Marginal structural models (MSM): To help contextualize SNM, we can contrast them with MSM. The 'marginal' in MSM refers to the fact that our model is marginal (i.e., not conditional on $$W$$). 'Structural' refers to the fact that the model includes potential outcomes. 'Model' indicates we are using some model. An example of an MSM would be $$E[Y^a] = \beta_0 + \beta_1 a$$ Note that this is the same estimand as the g-formula. One way to estimate the parameters of a MSM is using inverse probability weighting (there are also other ways).

We can also consider MSM that capture effect measure modification (termed 'faux MSM' since we are no longer marginal). The following is an example $$E[Y^a] = \beta_0 + \beta_1 a + \beta_2 V + \beta_3 a V$$ Note that this model includes 4 parameters, unlike the SNM. So, if we interpret the parameters of the MSM, we need to refer to them as conditional on $$V$$. This is not the case for the SNM (it only has two parameters, neither of which is a main effect for $$V$$). This difference is what makes SNM capable of capturing time-varying effect measure modification, whereas MSM do not.

To see these different methods in the context of time-varying confounding, I would recommend the following paper. The examples there should further clarify the distinctions between these terms.

• Hi Ben. So, I would say that the distinction between the terms (and whether there even is) does not have a consensus. People often use them interchangeably. My distinction above is based on conversations with other causal inference researchers. However, you see this in the literature. For example, from Tchetgen Tchetgen et al. JASA 2021: "[t]his approach to evaluating the g-formula is the network analogue of Monte Carlo sampling approaches to evaluating functionals arising from the g-computation algorithm" Apr 7 at 21:07
• Great answer as usual :) I have a minor quibble about the "marginal" in MSM. See this paper by your colleagues at UNC.
– Noah
Apr 11 at 20:33
• Also, to add a quote about g-computation/g-formula, from Snowden et al. (2011): "G-computation, a maximum likelihood substitution estimator of the G-formula, is one such approach to causal-effect estimation." Of course the maximum likelihood part is unnecessary (i.e., it can be implemented using other estimating methods, including machine learning), but the key is that it is a substation estimator of (the components of) the g-formula.
– Noah
Apr 11 at 20:37
• Great question @RobertF . The predicted outcome from the model (the second option) is used. In my experience, they don't differ much in simulations I've done comparing them. May 9 at 16:47
• Most people use a nonparametric bootstrap to get the standard errors. But you can also use the sandwich variance (as long as both the nuisance model and ATE/ATT are estimated simultaneously). I use this latter approach because (1) I wrote software to do it and (2) the bootstrap is computationally expensive. Here is an example (in the context of covariate adjustment in a trial) github.com/pzivich/Delicatessen/blob/main/examples/… May 12 at 15:19