Estimating a weighted regression based on weighted sample from Generalized Random Forest (grf) package 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.


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.
