All problems
Inconsistency Factor
Problem
Return the network meta-analysis inconsistency factor (d_direct - d_indirect)/sqrt(se_direct^2 + se_indirect^2). Return 0.0 when the combined variance is not positive.
Hint
The factor standardizes the direct-indirect gap by its combined uncertainty.
Test cases
case 1
in: [0.5,0.1,0.3,0.15]
expected: 1.1094003924504583
case 2
in: [0.5,0.2,0.5,0.2]
expected: 0
case 3
in: [1,0.1,0.5,0.1]
expected: 3.535533905932737
case 4
in: [0.2,0,0.2,0]
expected: 0
case 5
in: [-0.3,0.2,0.1,0.1]
expected: -1.7888543819998317
Starter codePython
def inconsistency_factor(d_direct, se_direct, d_indirect, se_indirect):
# Your code here
pass5 test cases · run your code against them in the editor