one_sided
[source]
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)
alignment
[source]
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_att
[source]
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_att
[source]
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)
class
Sensitivity
[source]
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/
class
SensitivityPlaceboTreatment
[source]
SensitivityPlaceboTreatment
(*args
, **kwargs
) ::Sensitivity
Replaces the treatment variable with a new variable randomly generated.
class
SensitivityRandomCause
[source]
SensitivityRandomCause
(*args
, **kwargs
) ::Sensitivity
Adds an irrelevant random covariate to the dataframe.
class
SensitivityRandomReplace
[source]
SensitivityRandomReplace
(*args
, **kwargs
) ::Sensitivity
Replaces a random covariate with an irrelevant variable.
class
SensitivitySubsetData
[source]
SensitivitySubsetData
(*args
, **kwargs
) ::Sensitivity
Takes a random subset of size sample_size of the data.
class
SensitivitySelectionBias
[source]
SensitivitySelectionBias
(*args
,confound
='one_sided'
,alpha_range
=None
,sensitivity_features
=None
, **kwargs
) ::Sensitivity
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