mcf_functions.ModifiedCausalForest.sensitivity#
- ModifiedCausalForest.sensitivity(train_df, predict_df=None, results=None, sens_cbgate=None, sens_bgate=None, sens_gate=None, sens_iate=None, sens_iate_se=None, sens_scenarios=None, sens_cv_k=None, sens_replications=2, sens_reference_population=None)#
Compute simulation based sensitivity indicators.
- Parameters
train_df (DataFrame.) – Data with real outcomes, treatments, and covariates. Data will be transformed to compute sensitivity indicators.
predict_df (DataFrame (or None), optinal.) – Prediction data to compute all effects for. This data will not be changed in the computation process. Only covariate information is used from this dataset. If predict_df is not a DataFrame, train_df will be used instead.
results (dictionary, optional.) – The standard output dictionary from the
predict()
method is expected. If this dictionary contains estimated IATEs, the same data as in thepredict()
method will be used, IATEs are computed under the no effect (basic) scenario and these IATEs are compared to the IATEs contained in the results dictionary. If the dictionary does not contain estimated IATEs, passing it has no consequence.sens_cbgate (Boolean (or None), optional) – Compute CBGATEs for sensitivity analysis. Default is False.
sens_bgate (Boolean (or None), optional) – Compute BGATEs for sensitivity analysis. Default is False.
sens_gate (Boolean (or None), optional) – Compute GATEs for sensitivity analysis. Default is False.
sens_iate (Boolean (or None), optional) – Compute IATEs for sensitivity analysis. If the results dictionary is passed, and it contains IATEs, then the default value is True, and False otherwise.
sens_iate_se (Boolean (or None), optional) – Compute Standard errors of IATEs for sensitivity analysis. Default is False.
sens_scenarios (List or tuple of strings, optional.) – Different scenarios considered. Default is (‘basic’,). ‘basic’ : Use estimated treatment probabilities for simulations. No confounding.
sens_cv_k (Integer (or None), optional) – Data to be used for any cross-validation: Number of folds in cross-validation. Default (or None) is 5.
sens_replications (Integer (or None), optional.) – Number of replications for simulating placebo treatments. Default is 2.
sens_reference_population (integer or float (or None)) – Defines the treatment status of the reference population used by the sensitivity analysis. Default is to use the treatment with most observed observations.
outpath (String) – Location of directory in which output is saved.
- Returns
results_avg (Dictionary) – Same content as for the
predict()
method but (if applicable) averaged over replications.outpath (String) – Location of directory in which output is saved.