8
8
class CausalValidator :
9
9
"""A suite of validation tools to perform Quantitive Bias Analysis to back up causal claims"""
10
10
11
- def estimate_robustness (self , model : RegressionResultsWrapper , q = 1 , alpha = 1 ):
11
+ @staticmethod
12
+ def estimate_robustness (model : RegressionResultsWrapper , q = 1 , alpha = 1 ):
12
13
"""Calculate the robustness of a linear regression model. This allow
13
14
the user to identify how large an unidentified confounding variable
14
15
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):
24
25
25
26
return rv
26
27
27
- def estimate_e_value (self , risk_ratio : float ) -> float :
28
+ @staticmethod
29
+ def estimate_e_value (risk_ratio : float ) -> float :
28
30
"""Calculate the E value from a risk ratio. This allow
29
31
the user to identify how large a risk an unidentified confounding
30
32
variable would need to be to nullify the causal relationship
@@ -36,7 +38,8 @@ def estimate_e_value(self, risk_ratio: float) -> float:
36
38
risk_ratio_prime = 1 / risk_ratio
37
39
return risk_ratio_prime + math .sqrt (risk_ratio_prime * (risk_ratio_prime - 1 ))
38
40
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 :
40
43
"""Calculate the E value from a risk ratio and it's confidence intervals.
41
44
This allow the user to identify how large a risk an unidentified
42
45
confounding variable would need to be to nullify the causal relationship
0 commit comments