causal_testing.estimation.abstract_estimator

This module contains the Estimator abstract class

Module Contents

Classes

Estimator

An estimator contains all of the information necessary to compute a causal estimate for the effect of changing

Attributes

logger

causal_testing.estimation.abstract_estimator.logger
class causal_testing.estimation.abstract_estimator.Estimator(base_test_case: causal_testing.testing.base_test_case.BaseTestCase, treatment_value: float, control_value: float, adjustment_set: set, df: pandas.DataFrame = None, effect_modifiers: dict[str, Any] = None, alpha: float = 0.05, query: str = '')

Bases: abc.ABC

An estimator contains all of the information necessary to compute a causal estimate for the effect of changing a set of treatment variables to a set of values.

All estimators must implement the following two methods:

1) add_modelling_assumptions: The validity of a model-assisted causal inference result depends on whether the modelling assumptions imposed by a model actually hold. Therefore, for each model, is important to state the modelling assumption upon which the validity of the results depend. To achieve this, the estimator object maintains a list of modelling assumptions (as strings). If a user wishes to implement their own estimator, they must implement this method and add all assumptions to the list of modelling assumptions.

2) estimate_ate: All estimators must be capable of returning the average treatment effect as a minimum. That is, the average effect of the intervention (changing treatment from control to treated value) on the outcome of interest adjusted for all confounders.

abstract add_modelling_assumptions()

Add modelling assumptions to the estimator. This is a list of strings which list the modelling assumptions that must hold if the resulting causal inference is to be considered valid.

compute_confidence_intervals() list[float, float]

Estimate the 95% Wald confidence intervals for the effect of changing the treatment from control values to treatment values on the outcome. :return: 95% Wald confidence intervals.