You will write the functions that turn a table of age groups into group rates, a standardised rate and the number of deaths to expect.
The idea. Each group rate is . The standardised rate is , where is a group rate and its standard weight. Expected events are .
Your tasks.
group_rates(deaths, people). Return a list with the rate of each group.standardised(rates, standard). Return the weighted average of the rates with the standard as weights.expected(rates, people). Return the total number of events the rates give for these groups.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…