causal_testing.estimation.logistic_regression_estimator

This module contains the LogisticRegressionEstimator class for estimating categorical outcomes.

Module Contents

Classes

LogisticRegressionEstimator

A Logistic Regression Estimator is a parametric estimator which restricts the variables in the data to a linear

Attributes

logger

causal_testing.estimation.logistic_regression_estimator.logger
class causal_testing.estimation.logistic_regression_estimator.LogisticRegressionEstimator(treatment_variable: str, outcome_variable: str, control_value: float = None, treatment_value: float = None, adjustment_set: set[str] = None, adjustment_config: dict[str, Any] = None, formula: str = None, alpha: float = 0.05)

Bases: causal_testing.estimation.abstract_regression_estimator.RegressionEstimator

A Logistic Regression Estimator is a parametric estimator which restricts the variables in the data to a linear combination of parameters and functions of the variables (note these functions need not be linear). It is designed for estimating categorical outcomes.

regressor
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.

estimate_unit_odds_ratio(df: pandas.DataFrame) → causal_testing.estimation.effect_estimate.EffectEstimate

Estimate the odds ratio of increasing the treatment by one. In logistic regression, this corresponds to the coefficient of the treatment of interest.

Parameters:

df – The data to use.

Returns:

The odds ratio with confidence intervals.