ananke.estimation
ananke.estimation.automated_if
Class for automated derivation of influence functions.
ananke.estimation.counterfactual_mean
Class that provides an interface to estimation strategies for the counterfactual mean E[Y(t)]
- class ananke.estimation.counterfactual_mean.CausalEffect(graph, treatment, outcome)[source]
Bases:
object
Provides an interface to various estimation strategies for the ACE: E[Y(1) - Y(0)].
- compute_effect(data, estimator, model_binary=None, model_continuous=None, n_bootstraps=0, alpha=0.05, report_log_odds=True)[source]
Bootstrap functionality to compute the Average Causal Effect if the outcome is continuous or the Causal Odds Ratio if the outcome is binary. Returns the point estimate as well as lower and upper quantiles for a user specified confidence level.
- Parameters
data – pandas data frame containing the data.
estimator – string indicating what estimator to use: e.g. eff-apipw.
model_binary – string specifying modeling strategy to use for binary variables: e.g. glm-binary.
model_continuous – string specifying modeling strategy to use for continuous variables: e.g. glm-continuous.
n_bootstraps – number of bootstraps.
alpha – the significance level with the default value of 0.05.
report_log_odds – if set to True, and the outcome variable is binary, then reports the log odds ratio.
- Returns
one float corresponding to ACE/OR if n_bootstraps=0, else three floats corresponding to ACE/OR, lower quantile, upper quantile.