2

I am using the grf package from R (https://grf-labs.github.io/grf/articles/grf.html) for treatment effect analysis. The package runs a procedure to identify a matched (or weighted) sample of treatment and control units. I would like to use the weighted sample from the grf procedure to run my own regression analysis using the lm function in R. Does any one knows how to extract the weighted sample to replace Z in the following model.

lmresult = lm(variable~treatment,data=data.df,weights=Z), where variable is the dependent variable of interest and treatment is an indicator that equals 1 for treatment unit and 0 for control unit.

Thanks in advance for any help.

Fred
  • 21

1 Answers1

1

The package runs a procedure to identify a matched (or weighted) sample of treatment and control units.

This is not what the package does, so you can't use it for that. The package estimates propensity scores and potential outcomes for each unit. In order to estimate the treatment effect and its confidence interval, you need to use the functions within the package. If you want to perform inverse probability weighting, there are other packages, like WeightIt and PSWeight, that do that.

Noah
  • 33,180
  • 3
  • 47
  • 105
  • Thanks. So I want to use the grf package to estimate the average treatment effect. Now, I wonder if I can identify the weighted sample that was conditional on the set of observed covariates. There is a function "get_forest_weights" that seems to do this, but whenever I run it, the software crashes. – Fred Jul 15 '22 at 00:45
  • Those weights are not inverse probability weights. They are an intermediate step in the model fitting process. Is there a reason you think GRF is supposed to give you inverse probability weights? If you want to estimate the average treatment effect, why don't you follow the instructions in the package's documentation for how to do that? – Noah Jul 15 '22 at 02:19