File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change 6
6
7
7
8
8
class CausalValidator :
9
+ """A suite of validation tools to perform Quantitive Bias Analysis to back up causal claims"""
10
+
9
11
def estimate_robustness (self , model : RegressionResultsWrapper , q = 1 , alpha = 1 ):
10
12
"""Calculate the robustness of a linear regression model. This allow
11
13
the user to identify how large an unidentified confounding variable
@@ -41,15 +43,14 @@ def estimate_e_value(
41
43
42
44
return (e , (lower_limit , 1 ))
43
45
44
- else :
45
- risk_ratio_prime = 1 / risk_ratio
46
- e = risk_ratio_prime + math .sqrt (risk_ratio_prime * (risk_ratio_prime - 1 ))
46
+ risk_ratio_prime = 1 / risk_ratio
47
+ e = risk_ratio_prime + math .sqrt (risk_ratio_prime * (risk_ratio_prime - 1 ))
47
48
48
- upper_limit = confidence_intervals [1 ]
49
- if upper_limit >= 1 :
50
- upper_limit = 1
51
- else :
52
- upper_limit_prime = 1 / upper_limit
53
- upper_limit = upper_limit_prime + math .sqrt (upper_limit_prime * (upper_limit_prime - 1 ))
49
+ upper_limit = confidence_intervals [1 ]
50
+ if upper_limit >= 1 :
51
+ upper_limit = 1
52
+ else :
53
+ upper_limit_prime = 1 / upper_limit
54
+ upper_limit = upper_limit_prime + math .sqrt (upper_limit_prime * (upper_limit_prime - 1 ))
54
55
55
- return (e , (1 , upper_limit ))
56
+ return (e , (1 , upper_limit ))
You can’t perform that action at this time.
0 commit comments