@@ -343,7 +343,7 @@ def add_modelling_assumptions(self):
343
343
"do not need to be linear."
344
344
)
345
345
346
- def estimate_coefficient (self ) -> float :
346
+ def estimate_coefficient (self ) -> tuple [ pd . Series , list [ pd . Series , pd . Series ]] :
347
347
"""Estimate the unit average treatment effect of the treatment on the outcome. That is, the change in outcome
348
348
caused by a unit change in treatment.
349
349
@@ -364,7 +364,7 @@ def estimate_coefficient(self) -> float:
364
364
[ci_low , ci_high ] = self ._get_confidence_intervals (model , treatment )
365
365
return unit_effect , [ci_low , ci_high ]
366
366
367
- def estimate_ate (self ) -> tuple [float , list [float , float ], float ]:
367
+ def estimate_ate (self ) -> tuple [pd . Series , list [pd . Series , pd . Series ] ]:
368
368
"""Estimate the average treatment effect of the treatment on the outcome. That is, the change in outcome caused
369
369
by changing the treatment variable from the control value to the treatment value.
370
370
@@ -413,7 +413,7 @@ def estimate_control_treatment(self, adjustment_config: dict = None) -> tuple[pd
413
413
414
414
return y .iloc [1 ], y .iloc [0 ]
415
415
416
- def estimate_risk_ratio (self , adjustment_config : dict = None ) -> tuple [float , list [float , float ]]:
416
+ def estimate_risk_ratio (self , adjustment_config : dict = None ) -> tuple [pd . Series , list [pd . Series , pd . Series ]]:
417
417
"""Estimate the risk_ratio effect of the treatment on the outcome. That is, the change in outcome caused
418
418
by changing the treatment variable from the control value to the treatment value.
419
419
@@ -426,9 +426,7 @@ def estimate_risk_ratio(self, adjustment_config: dict = None) -> tuple[float, li
426
426
ci_high = pd .Series (treatment_outcome ["mean_ci_upper" ] / control_outcome ["mean_ci_lower" ])
427
427
return pd .Series (treatment_outcome ["mean" ] / control_outcome ["mean" ]), [ci_low , ci_high ]
428
428
429
- return (treatment_outcome ["mean" ] / control_outcome ["mean" ]), [ci_low , ci_high ]
430
-
431
- def estimate_ate_calculated (self , adjustment_config : dict = None ) -> tuple [float , list [float , float ]]:
429
+ def estimate_ate_calculated (self , adjustment_config : dict = None ) -> tuple [pd .Series , list [pd .Series , pd .Series ]]:
432
430
"""Estimate the ate effect of the treatment on the outcome. That is, the change in outcome caused
433
431
by changing the treatment variable from the control value to the treatment value. Here, we actually
434
432
calculate the expected outcomes under control and treatment and divide one by the other. This
0 commit comments