Returns a fitted CATE \(\tau(Z)\) where covariates \(Z_S\) has no effect modification given the remaining covariates. It employs R-loss and cross fitting to estimate $$\mathbb{E}[Y|T,Z] = \mu_0(Z) + T \cdot \tau(Z), \quad \mu_0(Z) := \mathbb{E}[Y \mid T=0, Z].$$
Arguments
- y
Numeric response vector of length n.
- X
Matrix \(X = [T, Z]\) of dimension n x (p+1), where the first column is the binary treatment T and the remaining are the covariates Z.
- w
Non-negative numeric weight vector of length n. Defaults to
rep(1, nrow(X)). Applied when fitting the CATE (with weights \(\tilde{T}^2 w\)) and the control mean (with weights \(w\)). When it is not constant, this amounts to fitting CATE (or rather \(\mathbb{E}[Y | T, Z]\)) using weighted least squares.- S
A subset of
1:(ncol(X)-1)such thatX[,-1][,S]gives the covariates S which have no effect modification conditionally. WhenS=1:(ncol(X)-1), CATE must be a constant; whenS=NULL, CATE is unrestricted.- folds.crossfit
An integer for the number of folds in cross fitting using the R-loss to estimate CATE. When it is 1, no cross fitting is used.
- randomized
If
FALSE(default), the propensity \(e(Z) = \mathbb{E}[T \mid Z]\) is estimated by a cross-fittedgrf::probability_forest. IfTRUE, \(T\) is assumed to be randomized (independent ofZ), so \(e(Z)\) is taken to be the constantmean(T), fitted upfront on the full sample without cross-fitting.
