reconhub / incidence

☣:chart_with_upwards_trend::chart_with_downwards_trend:☣ Compute and visualise incidence
https://reconhub.github.io/incidence
Other
58 stars 13 forks source link

*epiweek*: use flexible calendar week definition #24

Closed thibautjombart closed 6 years ago

thibautjombart commented 7 years ago

Ask Johannes @ WHO :)

caijun commented 7 years ago

We may be interested in the R package MMWRweek, which provides functionality to convert Dates to MMWR day, week, and year and the reverse according to the MMWR week definition.

thibautjombart commented 7 years ago

I expected you'd have good suggestions @caijun ;) Definitely looks relevant. Beyond this one, there was a question of using arbitrary epi week definition. I think this may actually motivate a small package in its own right. Could be a wrapper for isoweek and MMWRweek, and then some further code to implement arbitrary week definition. What do you think?

caijun commented 7 years ago

@thibautjombart could you give a specific example of using arbitrary epi week?

Moreover, before developing a new package epiweek, I think we need to summarise various definitions of weeks used in epidemiological reports, e.g. ISO 8601 week, MMWR week etc. Any other epi weeks?

thibautjombart commented 7 years ago

@caijun for arbitrary week definition, I mean week 0 or 1 could be the week of the first reported case, or the first onset of symptoms. It means generally speaking we should be able to count weeks from a given day. Formally, that means we'd find week definitions so that:

  1. All weeks start on a given day (e.g. Monday or Sunday)
  2. Week 1 (or week 0 if this is used) contains a given date, representing the start of the outbreak.

Does it make sense?

caijun commented 7 years ago

I see. Yes, there are various epidemiological data analysis using the (reporting, symptom onset, confirmation, whatever) date of the first case as the start of the week. Definitely, we should support this kind of definition of epi week.

Besides, I find a useful discussion on epidemiological week definitions. It listed five types of epi weeks. Together with the arbitrary week you mentioned, I think the epiweek package should support 6 kinds of epi week definitions.

https://stackoverflow.com/questions/28238438/epidemiological-curve-using-r-and-epitools-gives-wrong-epiweeks

Besides, from the above SO discussion, we see that sometimes one may not be able to reproduce the epidemic curve because of using the incorrect epi week definition. Therefore, it's necessary to develop a epiweek package to guide epidemiologists the usages of different epi week definitions. Of course, it is necessary to point out the epi week definition in epidemiological reports, especially when weekly epidemic curve is presented.

caijun commented 7 years ago

The url may also be helpful.

https://wiki.ecdc.europa.eu/fem/f/1287/p/576/681#681

thibautjombart commented 7 years ago

Thanks for the useful links. Besides, I not there is an epiweek package: https://cran.r-project.org/web/packages/EpiWeek/index.html

But it only covers part of what we are discussing here. It would be useful to post this on the forum, see if others have comments / suggestions. Would you like to start this, or shall I?

Unrelated: if we create a RECON package for epi weeks, would you like to lead this?

caijun commented 7 years ago

I just glimpse the manual of the EpiWeek package and it involves only one definition of epidemiological week. It's a good idea to post this issue on the forum to see whether it's necessary to develop such an R package. I think it's better that you post this issue on the forum so that more people maybe participate in the discussion.

I am glad to lead the development of the RECON package for epi weeks.

thibautjombart commented 7 years ago

Great for the package lead. Will post and link from here.

thibautjombart commented 7 years ago

Posted on the forum: http://discourse.repidemicsconsortium.org/t/epiweeks-what-do-people-need/84

I will summarise feedback here.

thibautjombart commented 7 years ago

Key issue to address: what do we call the package? There is an epitrix.. could be an epiwix?

caijun commented 7 years ago

How about epiweeks? But it very similar to the existing R package EpiWeek. epiwix is pronounced as epiweeks, is a good choice.

thibautjombart commented 7 years ago

Yes a bit too similar - this is why I thought a mis-spelled version was an alternative ;)

caijun commented 7 years ago

OK, let's name it epiwix.

thibautjombart commented 6 years ago

I don't know if this is still ongoing. If it is, it is externalised, so closing this issue.