Description Usage Arguments Details Value Methods (by class) Note References Examples
Computes a matrix of double robust scores Γ_{ia} = μ_a(x) + \frac{1}{e_a(x)} (Y_i  μ_a(x)) 1(A_i=a)
1 2 3 4 5 6 7 8 9 10  ## S3 method for class 'causal_forest'
double_robust_scores(object, ...)
## S3 method for class 'instrumental_forest'
double_robust_scores(object, compliance.score = NULL, ...)
## S3 method for class 'multi_arm_causal_forest'
double_robust_scores(object, outcome = 1, ...)
double_robust_scores(object, ...)

object 
An appropriate causal forest type object 
... 
Additional arguments 
compliance.score 
An estimate of the causal effect of Z on W. i.e., Delta(X) = E(W  X, Z = 1)  E(W  X, Z = 0), for each sample i = 1, ..., n. If NULL (default) then this is estimated with a causal forest. 
outcome 
Only used with multi arm causal forets. In the event the forest is trained with multiple outcomes Y, a column number/name specifying the outcome of interest. Default is 1. 
This is the matrix used for CAIPWL (Crossfitted Augmented Inverse Propensity Weighted Learning)
A matrix of scores for each treatment
causal_forest
: Scores (Γ_0, Γ_1)
instrumental_forest
: Scores (Γ, Γ)
multi_arm_causal_forest
: Matrix Γ of scores for each treatment a
For instrumental_forest this method returns (Γ_i, Γ_i) where Γ_i is the double robust estimator of the treatment effect as in eqn. (44) in Athey and Wager (2021).
Athey, Susan, and Stefan Wager. "Policy Learning With Observational Data." Econometrica 89.1 (2021): 133161.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  # Compute double robust scores for a multiarm causal forest
n < 500
p < 10
X < matrix(rnorm(n * p), n, p)
W < as.factor(sample(c("A", "B", "C"), n, replace = TRUE))
Y < X[, 1] + X[, 2] * (W == "B") + X[, 3] * (W == "C") + runif(n)
forest < grf::multi_arm_causal_forest(X, Y, W)
scores < double_robust_scores(forest)
head(scores)
# Compute double robust scores for a causal forest
n < 500
p < 10
X < matrix(rnorm(n * p), n, p)
W < rbinom(n, 1, 0.5)
Y < pmax(X[, 1], 0) * W + X[, 2] + pmin(X[, 3], 0) + rnorm(n)
c.forest < grf::causal_forest(X, Y, W)
scores < double_robust_scores(c.forest)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.