grf-labs / grf

Generalized Random Forests
https://grf-labs.github.io/grf/
GNU General Public License v3.0
970 stars 249 forks source link

Is there a way to estimate the standard errors for a linear combination of the ATE across multiple arms? #1430

Open DanKluger opened 3 months ago

DanKluger commented 3 months ago

When applying the "average_treatment_effect" function to the output of a "multi_arm_causal_forest" with K>2 arms, a table with K-1 ATEs is returned along with standard error estimates for those ATEs. I'm not sure if the covariance matrix of the K-1 ATE estimators is stored anywhere, but I was wondering if it is at all possible to obtain the standard errors for an arbitrary linear combination of the K-1 ATEs?

I am particularly motivated by an example where there are two binary treatments that take values in {0,1} and would like to estimate the interaction between the two treatments given by E[Y(1,1)-Y(0,1)-Y(1,0)+Y(0,0)]. I was able to get a point estimate of this interaction by first running "multi_arm_causal_forest" where the arms were the 4 combinations of the treatments and by afterwards taking sums and differences between the ATE estimates returned by "average_treatment_effect". However, I was unable to obtain a confidence interval for the estimated interaction. In case it is helpful for clarity, I am attaching an example of an attempt to do this on synthetic data.

Thank you very much for maintaining this useful package and for considering this query.

GithubInteractionQuestion.pdf

mollyow commented 1 month ago

Hi Dan!

You should be able to calculate the estimate as a linear function of doubly robust scores, which you can get from get_scores(<forest>).

You can then calculate the standard error of the estimate as sd(<linear combination of scores>)/sqrt(n).

https://gist.github.com/mollyow/a55a0342fec3a2c50c4b78b27a4a0e35