All problems
P-Score Lite
Problem
Return the frequentist P-score of the study at index: (count of effects below its effect + 0.5*count of ties)/(k-1), ignoring uncertainty. Return 0.0 when there are fewer than two studies or the index is out of range.
Hint
P-scores rank treatments from 1 (best) to 0 (worst) without uncertainty.
Test cases
case 1
in: [[1,2,3],2]
expected: 1
case 2
in: [[1,2,3],0]
expected: 0
case 3
in: [[1,2,2],2]
expected: 0.75
case 4
in: [[5,5,5],1]
expected: 0.5
case 5
in: [[1],0]
expected: 0
Starter codePython
def p_score(effects, index):
# Your code here
pass5 test cases · run your code against them in the editor