Metalearner Sensitivity
SensitivitySelectionBias
SensitivitySelectionBias (*args, confound='one_sided', alpha_range=None, sensitivity_features=None, **kwargs)
*Reference:
[1] Blackwell, Matthew. “A selection bias approach to sensitivity analysis for causal effects.” Political Analysis 22.2 (2014): 169-182. https://www.mattblackwell.org/files/papers/causalsens.pdf
[2] Confouding parameter alpha_range using the same range as in: https://github.com/mattblackwell/causalsens/blob/master/R/causalsens.R*
SensitivitySubsetData
SensitivitySubsetData (*args, **kwargs)
Takes a random subset of size sample_size of the data.
SensitivityRandomReplace
SensitivityRandomReplace (*args, **kwargs)
Replaces a random covariate with an irrelevant variable.
SensitivityRandomCause
SensitivityRandomCause (*args, **kwargs)
Adds an irrelevant random covariate to the dataframe.
SensitivityPlaceboTreatment
SensitivityPlaceboTreatment (*args, **kwargs)
Replaces the treatment variable with a new variable randomly generated.
Sensitivity
Sensitivity (df, inference_features, p_col, treatment_col, outcome_col, learner, *args, **kwargs)
*A Sensitivity Check class to support Placebo Treatment, Irrelevant Additional Confounder and Subset validation refutation methods to verify causal inference.
Reference: https://github.com/microsoft/dowhy/blob/master/dowhy/causal_refuters/*
alignment_att
alignment_att (alpha, p, treatment)
*Alignment confounding function for the average effect of the treatment among the treated units (ATT)
Reference: Blackwell, Matthew. “A selection bias approach to sensitivity analysis for causal effects.” Political Analysis 22.2 (2014): 169-182. https://www.mattblackwell.org/files/papers/causalsens.pdf
Args: alpha (np.array): a confounding values vector p (np.array): a propensity score vector between 0 and 1 treatment (np.array): a treatment vector (1 if treated, otherwise 0)*
one_sided_att
one_sided_att (alpha, p, treatment)
*One sided confounding function for the average effect of the treatment among the treated units (ATT)
Reference: Blackwell, Matthew. “A selection bias approach to sensitivity analysis for causal effects.” Political Analysis 22.2 (2014): 169-182. https://www.mattblackwell.org/files/papers/causalsens.pdf
Args: alpha (np.array): a confounding values vector p (np.array): a propensity score vector between 0 and 1 treatment (np.array): a treatment vector (1 if treated, otherwise 0)*
alignment
alignment (alpha, p, treatment)
*Alignment confounding function. Reference: Blackwell, Matthew. “A selection bias approach to sensitivity analysis for causal effects.” Political Analysis 22.2 (2014): 169-182. https://www.mattblackwell.org/files/papers/causalsens.pdf
Args: alpha (np.array): a confounding values vector p (np.array): a propensity score vector between 0 and 1 treatment (np.array): a treatment vector (1 if treated, otherwise 0)*
one_sided
one_sided (alpha, p, treatment)
*One sided confounding function. Reference: Blackwell, Matthew. “A selection bias approach to sensitivity analysis for causal effects.” Political Analysis 22.2 (2014): 169-182. https://www.mattblackwell.org/files/papers/causalsens.pdf
Args: alpha (np.array): a confounding values vector p (np.array): a propensity score vector between 0 and 1 treatment (np.array): a treatment vector (1 if treated, otherwise 0)*