All problems
E-Value for Unmeasured Confounding
Problem
Return the E-value for unmeasured confounding, RR + sqrt(RR*(RR - 1)) with RR = max(risk_ratio, 1/risk_ratio). The E-value is the minimum strength of association an unmeasured confounder would need to explain the effect away. Return 0.0 when risk_ratio is not positive.
Hint
Fold protective effects to their reciprocal before applying the formula.
Test cases
case 1
in: [2]
expected: 3.414213562373095
case 2
in: [1]
expected: 1
case 3
in: [0.5]
expected: 3.414213562373095
case 4
in: [3]
expected: 5.449489742783178
case 5
in: [0]
expected: 0
Starter codePython
def e_value(risk_ratio):
# Your code here
pass5 test cases · run your code against them in the editor