CoVaRR-NET / duotang

Scripts and data for the CoVaRR-Net Pillar 6 notebook
https://covarr-net.github.io/duotang/duotang.html
MIT License
1 stars 2 forks source link

Fix r estimates to be daily even if data interval is weekly #280

Closed spotto closed 11 months ago

spotto commented 11 months ago

There’s a bug in plot_case_count_selection_estimator.R. All of the provinces with weekly data should have their r values divided by 7. Here’s the problematic line in the code (fixed this issue only for Canada):

if (region == “Canada”){
  rValues[lineFits[[i]]$names] <- as.numeric(rValues[lineFits[[i]]$names]) / 7
}

To fix this in a more robust way, check the interval between the last two dates (used in the calculation of r) and divide by their difference.

Slack Message