# which variables appear to make a difference for treatment effects? HTE?# we can inspect variable_importance, which measures how often a variable Xj was split on.;varimp <-variable_importance(cforest)ranked.vars <-order(varimp, decreasing =TRUE)# Top 5 variables according to this measurecolnames(X)[ranked.vars[1:5]]
# test whether there is HTE;test_calibration(cforest)
Best linear fit using forest predictions (on held-out data)
as well as the mean forest prediction as regressors, along
with one-sided heteroskedasticity-robust (HC3) SEs:
Estimate Std. Error t value Pr(>t)
mean.forest.prediction 1.01764 0.23667 4.2998 0.00000869 ***
differential.forest.prediction 1.06305 0.66444 1.5999 0.05484 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#We can reject the null of no heterogeneity;# Conditional ATE for race#white;average_treatment_effect(cforest, target.sample ="all", subset = X[ , "racewhite"] ==1)