Description Usage Arguments Details Examples
This is a wrapper for grf::causal_forest()
which performs a causal forest estimation, pulls out the individual-level effect estimates (tau), and then returns a factor variable containing the quantiles of tau.
1 |
formula |
A formula of the form |
data |
A data.frame. |
ngroups |
Number of quantiles to split tau into. |
... |
Additional arguments to be passed to |
This function is called by magnifiedIV. You can also run Magnified IV by yourself (with any estimator) by running groupSearch, then adding the resulting group variable as a control in both IV stages and also interacted with the instrument. Or use grf::causal_forest()
directly to estimate tau on the individual level, and use that to construct a sample weight.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Get data
data(CPS1985, package = 'AER')
# See how the effect of education on wage varies over all the variables in the data
# and then split the resulting individual coefficient estimates into 10 quantiles
# (note this example probably does not satisfy the theoretical unconfoundedness
# assumption of causal forest; this is just a code example)
edeffect <- groupCF(wage ~ education |
experience + age + ethnicity +
region + gender + occupation +
sector + union + married,
data = CPS1985, ngroups = 10)
table(edeffect)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.