Closed lorenzoFabbri closed 1 year ago
G-computation is a method of estimating a counterfactual mean. It is precisely computing "predicted values of the outcome when the exposure is set to specific values". This is exactly what avg_predictions()
does. The contrast between two counterfactual means is the treatment effect. avg_comparisons()
both generates predictions at specific values of the exposure and computes the contrast between the counterfactual means.
With reference to the following piece of code, I am wondering whether this is actually G-computation. I thought G-computation would be performed with
marginaleffects::avg_comparisons()
. Aren't those just predicted values of the outcome when the exposure is set to specific values?