Skip to content

Commit 97164f3

Browse files
Move validation.py methods to static
1 parent f96aca0 commit 97164f3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

causal_testing/utils/validation.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
class CausalValidator:
99
"""A suite of validation tools to perform Quantitive Bias Analysis to back up causal claims"""
1010

11-
def estimate_robustness(self, model: RegressionResultsWrapper, q=1, alpha=1):
11+
@staticmethod
12+
def estimate_robustness(model: RegressionResultsWrapper, q=1, alpha=1):
1213
"""Calculate the robustness of a linear regression model. This allow
1314
the user to identify how large an unidentified confounding variable
1415
would need to be to nullify the causal relationship under test."""
@@ -24,7 +25,8 @@ def estimate_robustness(self, model: RegressionResultsWrapper, q=1, alpha=1):
2425

2526
return rv
2627

27-
def estimate_e_value(self, risk_ratio: float) -> float:
28+
@staticmethod
29+
def estimate_e_value(risk_ratio: float) -> float:
2830
"""Calculate the E value from a risk ratio. This allow
2931
the user to identify how large a risk an unidentified confounding
3032
variable would need to be to nullify the causal relationship
@@ -36,7 +38,8 @@ def estimate_e_value(self, risk_ratio: float) -> float:
3638
risk_ratio_prime = 1 / risk_ratio
3739
return risk_ratio_prime + math.sqrt(risk_ratio_prime * (risk_ratio_prime - 1))
3840

39-
def estimate_e_value_using_ci(self, risk_ratio: float, confidence_intervals: tuple[float, float]) -> float:
41+
@staticmethod
42+
def estimate_e_value_using_ci(risk_ratio: float, confidence_intervals: tuple[float, float]) -> float:
4043
"""Calculate the E value from a risk ratio and it's confidence intervals.
4144
This allow the user to identify how large a risk an unidentified
4245
confounding variable would need to be to nullify the causal relationship

0 commit comments

Comments
 (0)