R4EPI / sitrep

Report templates and helper functions for applied epidemiology
https://r4epi.github.io/sitrep/
GNU General Public License v3.0
40 stars 14 forks source link

CMR month chunk produces unrealistic CMR values compared to the overall summary CMR #283

Closed pbkeating closed 2 years ago

pbkeating commented 2 years ago

@aspina7 When running the CMR_months chunk in the mortality survey template the monthly CMR values obtained are unrealistically high e.g. get an overall CMR of 0.1 but have values of 13, 23, 65, 218 per month. I think there is an issue with the calculation of obstime here per month?

aspina7 commented 2 years ago

i dont see why that would happen - can share example data?

aspina7 commented 2 years ago

So the reason this is happening is that currently the obs are for the whole period - so we need to write a loop to calculate obstime for each month for each person and then calculate deaths(in that month)/month_obs to get appropriate estimates....