About a month ago I was asked by a friend if it was possible to create an interactive model for Covid-19. He was having the same issue with publicity around “flattening the curve” as me.
There were plenty of images like the above coming from the CDC, Johns Hokins and other institutions quickly running through media outlets. More than one world leader now has their picture taken holding printouts of the same or similar image.
While on the face its obvious what “flattening the curve” meant, the images themselves didn’t mean a whole lot. It gave us the why (why should we take this seriously) but not the when(s) and how many(s). How many beds do we have? How many people will get sick? When will the curve pass capacity? How long do we have to react?
Before looking further, let me stress: while I do have a background in Demography and statistics (with some limited epidemiology and public health experience) I am not an expert. To read more on what the experts are learning about Covid-19 I’d suggest visiting some of the usual suspects:
Now on to my project. Last week I finished putting together a shiny app that could give some figures to the when(s) and how many(s) while allowing for different scenarios to be tested. The image below is a capture of the app’s landing page, which you can click on to open the full app in a new tab.
So what is this app? What you can see is the side panel to the left which allows user inputs. The slider allows for changes to the assumed rates associated with Covid-19, defaulting to approximate values observed in other countries with the more mature outbreaks. The numeric fields allow for changes to the at risk population. These are defaulted to the approximate values for the Country of New Zealand. As these inputs are changed, the charts to the right will display the changes to the curve.
What are the Charts?
- Single Day Events- the curve shows how many people will be entering the hospital, entering the ICU, or dying on a given day. For quick reference the peak curve figures are also given at the top of the chart.
- Cumulative Deaths- Over the span of time, the total number of people who pass from the infection.
- Two “Average Length of Stay Scenarios”- There is one chart for Hospitalizations and a second for ICUs. Both charts show what would happen if the average length of stay was 2, 5, or 10 days. The curves represent how many people would be in the institutions on a given day. There are also a horizontal dashed lines that represents the estimated capacities entered in the side panel.
- People Transitioning Between States- the number of people each day that transition from Susceptible (not infected) to Exposed (infected, not contagious); Exposed to Infected (showing symptoms and contagious); and Infected to Recovered (no longer ill or contagious).
- Total Population Count by Day- the Total population for a given category. Two of these are mutually exclusive, Susceptible and Recovered. It is assumed once recovered you cannot be reinfected (meaning you can never be considered Susceptible again) That is why the trade off of these two populations can be seen in the chart. The other two categories are transitional states, Exposed and Infected. These two curves show the total number of people on a given day in one of those two states.
How should I use the App? In short, however you’d like. My only hope is that between the information in this post and in the app, that the app can be informative and used responsibly. While it may be tempting to max out the rates for curiosity, please don’t snip such charts and release them into the wild without context.
Do check back in on this blog and the app, as I will likely be adding/updating content in the coming weeks.
Until then, stay well.