| FX.Predictor | R Documentation |
Predictor class for the cross-fit predictor of "partial" CATEs
Predictor class for the cross-fit predictor of "partial" CATEs
The class makes it easier to manage the K predictors for retrieving K-fold cross-validated estimates, as well as to measure how treatment effects change when only a single covariate is changed from its "natural" levels (in the sense "natural" used by the direct / indirect effects literature).
modelsA list of the K model fits
num_splitsThe number of folds used in cross-fitting.
num_mc_samplesThe number of samples to retrieve across the covariate space. If num_mc_samples is larger than the sample size, then the entire dataset will be used.
covariatesThe unquoted names of the covariates used in the second-stage model.
model_classThe model class (in the sense of Model_cfg). For instance,
a SuperLearner model will have model class "SL".
new()FX.predictor is a class which simplifies the management of a set of cross-fit
prediction models of treatment effects and provides the ability to get the "partial"
effects of particular covariates.
FX.Predictor$new(models, num_splits, num_mc_samples, covariates, model_class)
modelsA list of the K model fits.
num_splitsInteger number of cross-fitting folds.
num_mc_samplesInteger number of Monte-Carlo samples across the covariate space. If this is larger than the sample size, then the whole dataset will be used.
covariatesThe unquoted names of the covariates.
model_classThe model class (in the sense of Model_cfg).
predict()Predicts the PCATE surface over a particular covariate, returning a tibble with the predicted HTE for every Monte-Carlo sample.
FX.Predictor$predict(data, covariate)
dataThe full dataset
covariateThe unquoted covariate name for which to calculate predicted treatment effects.
A tibble with columns:
covariate_value - The value of the covariate of interest
.hte - An estimated HTE
.id - The identifier for the original row (which had
covariate modified to covariate_value).
clone()The objects of this class are cloneable with this method.
FX.Predictor$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.