Skip to content
DeepForgeby svx
All problems
EasyStatisticsst-191

Indirect SMR

Problem

Return the standardized mortality ratio observed/expected after indirect standardization. Return 0.0 when expected <= 0.

Hint

Values above 1 mean more events than expected from the reference rates.

Test cases

case 1
in: [120,100]
expected: 1.2
case 2
in: [50,80]
expected: 0.625
case 3
in: [0,100]
expected: 0
case 4
in: [10,0]
expected: 0
case 5
in: [75,75]
expected: 1
Starter codePython
def standardized_mortality_ratio(observed, expected):
    # Your code here
    pass

5 test cases · run your code against them in the editor