Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date math / off-by-one: previous day admissions versus current day admissions #15

Closed
stephenturner opened this issue Dec 20, 2021 · 3 comments · Fixed by #47
Closed
Assignees

Comments

@stephenturner
Copy link
Contributor

From the flusight guidance:

Confirmed influenza hospital admission data are reported as “previous day” admissions in the raw data. Therefore, before aggregating to the weekly values, the gold standard or “truth” data will shift the values in the date column one day earlier so that the date aligns with the date of admission. As an example, if 17 confirmed influenza hospital admissions were reported in the previous_day_admission_influenza_confirmed field in a row where the date field was 2021-10-30, then the “truth” dataset would assign those 17 hospital admissions to a date of 2021-10-29. These cases would then be counted towards the weekly total computed for EW43, which runs from 2021-10-24 through 2021-10-30.

This should be considered when working on #9 , #10 , #12

@vpnagraj vpnagraj self-assigned this Dec 20, 2021
@stephenturner
Copy link
Contributor Author

There are lots of places throughout our code where we're doing something like mutate(date=date-1) %>% after pulling the hospitalization data from hdgov. Rather than try to handle this directly in #9 , #37 , etc., should we handle it directly in the get_hdgov_hosp function?

@vpnagraj
Copy link
Collaborator

good call. BUT lets be 101% sure that we fix all of those other places where we call date = date-1. may be good motivation to kill off orphan scratch scripts.

@stephenturner
Copy link
Contributor Author

fixed in #47 - I'd go ahead and merge main into whatever you're working on. This fixes the function to shift days back one day, but also comments out all instances of mutate(date=date-1) %>% in scratch scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants