Skip to content

Commit

Permalink
pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
jmafoster1 committed Sep 4, 2024
1 parent 2a7ce30 commit 673165c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions causal_testing/estimation/cubic_spline_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ def __init__(
self.formula = f"{outcome} ~ cr({'+'.join(terms)}, df={basis})"

def estimate_ate_calculated(self, adjustment_config: dict = None) -> pd.Series:
"""Estimate the ate effect of the treatment on the outcome. That is, the change in outcome caused
by changing the treatment variable from the control value to the treatment value. Here, we actually
calculate the expected outcomes under control and treatment and divide one by the other. This
allows for custom terms to be put in such as squares, inverses, products, etc.
:param: adjustment_config: The configuration of the adjustment set as a dict mapping variable names to
their values. N.B. Every variable in the adjustment set MUST have a value in
order to estimate the outcome under control and treatment.
:return: The average treatment effect.
"""
model = self._run_regression()

x = {"Intercept": 1, self.treatment: self.treatment_value}
Expand Down
4 changes: 4 additions & 0 deletions causal_testing/estimation/linear_regression_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ def estimate_ate_calculated(self, adjustment_config: dict = None) -> tuple[pd.Se
calculate the expected outcomes under control and treatment and divide one by the other. This
allows for custom terms to be put in such as squares, inverses, products, etc.
:param: adjustment_config: The configuration of the adjustment set as a dict mapping variable names to
their values. N.B. Every variable in the adjustment set MUST have a value in
order to estimate the outcome under control and treatment.
:return: The average treatment effect and the 95% Wald confidence intervals.
"""
if adjustment_config is None:
Expand Down

0 comments on commit 673165c

Please sign in to comment.