Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the best_linear_projection to get coefficient estimates for treatment and control separately #1468

Open
aczura2024 opened this issue Nov 4, 2024 · 1 comment

Comments

@aczura2024
Copy link

I am fitting a causal forest with 2 treatment arms and want to use the best_linear_projection() function to estimate the regression coefficients on the treatment and control groups separately. When I make a separate matrix corresponding to the observations solely in the treatment group, I get an error Error in best_linear_projection(mycrf, A = treat_covar[, 2:ncol(treat_covar)]) :
The number of rows of A does not match the number of training examples.

Any ideas?

@erikcs
Copy link
Member

erikcs commented Nov 14, 2024

That error message tells you that the number of rows in treat_covar is different from the number of samples used to train mycrf. BLP fits a linear model to $\tau(X)$. If you want to fit a linear model to either a) $E[Y_i(1)|X_i]$ or b) $E[Y_i(0)|X_i]$ you could construct doubly robust scores for those and run a linear model similarily to how BLP does it under the hood. policytree does the DR score calculation for a and b here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants