All problems
Responsiveness Index
Problem
Return Guyatt's responsiveness index mean(followup - baseline) / sd(followup - baseline), using the sample standard deviation of the change scores. Return 0.0 when fewer than two pairs are given, lengths differ, or the change scores are constant.
Hint
It standardizes the observed change by its own variability.
Test cases
case 1
in: [[50,60,70],[55,68,75]]
expected: 3.464101615137755
case 2
in: [[10,12,14],[10,12,14]]
expected: 0
case 3
in: [[1,2,3],[2,4,6]]
expected: 2
case 4
in: [[5,5],[7,7]]
expected: 0
case 5
in: [[1],[2]]
expected: 0
Starter codePython
def responsiveness_index(baseline, followup):
# Your code here
pass5 test cases · run your code against them in the editor