Friday, March 20, 2020

Spare the hospitals!

There’s been a lot of attention – and rightly so – on the idea of "flattening the curve," and specifically on the goal of keeping the rate of serious cases below the capacity of the medical system.

If we succeed in that, we win in two ways.

First, critical CoVID-19 patients can get the care they need. At the moment, Italy is the most publicized case of an overwhelmed medical system, and doctors there are having to make awful decisions about which patients get life-saving treatment and which don’t.

Second, if the medical system gets overwhelmed, people with all sorts of medical conditions can’t get the treatment they need. Heart attack? Cancer treatment? Accident? Sorry, we’re busy, and the doctors, nurses are exhausted from trying to keep up with the CoVID-19 cases. If we keep the new virus under control, other people can continue to get treatment.

To reflect this problem, I’ve made two changes to the earlier model.

One of these is that there’s a defined level of hospital capacity.

For the other, the model makes a distinction between mild cases and severe ones. This is still a pretty big simplification, because there’s a meaningful difference between “severe,” which requires hospitalization, and “critical,” which requires hospitalization plus specialized equipment in limited supply.

The details of the model are below, or in the “Model Info” tab of the model.

If you just want to play with it, download the NetLogo Web version of the model from this link: https://drive.google.com/file/d/1CjFPbK9L6wMYTt9Ern_eb3cHLoA1JV-3/view?usp=sharing.



Save it to a useful place on your computer and open it up, and you should see the model.

You can set “hospital-capacity” to values of 4, 8, 12, ..., 60.

As in the first model, you can set “speed” to 1.0, reflecting business-as-usual, or you can set it to a lower number to reflect some degree of social distancing.

The “low-lethal” variable shows what percentage of the infected population will die when the medical system is able to stay on top of the situation. The further the number of severe cases goes above the hospital capacity, the more the lethality rises toward the level indicated by the “high-lethal” variable.

You can track the number of severe cases in the lower left of the six graphs that are to the right of the main “world” diagram. The red line shows hospital capacity, so you can whether the number of severe cases is below or above hospital capacity.

The case fatality rate (bottom-right graph) shows the number of fatalities divided by the number of people who’ve ever contracted the infection.

Because of the way the model runs together both “severe” and “critical” into a single “severe” category, it’s a bit tricky to know what a “realistic” number is for the hospital capacity. Community hospitals in the U.S. have about 924,000 staffed beds, which for a population of 330,000,000 is the same rate as a “hospital capacity” of 14 for a population of 5,000 in the model.

The country has about 98,000 intensive-care beds, which is like a “hospital capacity” of 1.5 for a population of 5,000 in the model.

(For numbers of hospital beds, see here.)

On a similar point of realism, you shouldn’t put too much confidence in this model’s specific predictions of lethality, overall infection, or overall rates of fatalities. What you can learn from it is the interaction among the low- and high-lethal variables, the hospital capacity, and the degree of social distancing.

You can download the model as described above and play with it on your own. I’ve also produced some charts based on the larger model that runs on a laptop (see the bottom of this post for that model, and for information about downloading NetLogo if you want to run the bigger model yourself).

The big model has 10,000 people rather than 5,000. I looked at values of “speed” from 0.2 (very strong social distancing) to 1.0 (no special measures at all). I also looked at values of hospital-capacity from 4 to 60.

As with the simpler model from the first post, I used an “infectiousness” of 65% and a “duration” of 20 (if you get sick, you’re sick for 20 days – that is apparently an overestimate of how long you’re sick with a mild case, but an underestimate of how long you’re sick if you have to be hospitalized).

With the average lethality, you can see something like a crease where the degree of social distancing ceases being enough to keep the virus within the medical system’s capacity. With no social distancing, lethality is high, and then falls away faster and faster to a “plane” of low lethality. With a very small hospital capacity (at the back of the diagram below), you don’t quite make it to the plane, even at maximum social distancing of 0.2. At the front of the diagram, where hospital capacity is high, you can control lethality with a speed of 0.5.



(You may notice the lumpiness of the plane, which is basically a small-numbers problem. With strong social distancing, there are under 100 infections out of 10,000 people. When you apply a 1% lethality rate to a number under 100, you get relatively large swings in outcomes from one run to another. If I had run 50 times at each set of parameters rather than 20, I expect the shape would be smoother.)

But of course we care not only about lethality (what portion of infected people will die) but also about society-wide death rates, and those are a combination of the rate at which people get infected and the lethality among those who are infected.

Not surprisingly given the structure of the model, the infection rate doesn’t depend on the hospital capacity. Increased social distancing brings down the overall rate of infection along a shape like a backwards “S”. And that shape is the same from the front of the graph to the back.


If we look at the back of the lethality diagram above, we see that when the hospital capacity is very small, lethality stays high even as we bring “speed” from 1.0 down to 0.6; at 0.5 there’s a meaningful drop, and then it falls quickly.

But if we look at society-wide death rates, they’re noticeably falling already when speed is at 0.7, and then rapidly after that through speed values of 0.6 and 0.5.



And at the bottom of the charts, you see on the lethality graph that lethality never goes below 1%. This virus is apparently a nasty piece of work, and if you get it there’s about a 1% chance it’ll kill you, even if good care is available. (This version of the lethality diagram is rotated a little, so you can see the space between the bottom of the curve and the floor of the diagram.)



But strong social distancing can keep the society-wide death rate down to practically zero, because so few people are infected: 1% of a small number is going to be almost nobody.

With strong social distancing (right edge of the graph), almost nobody gets sick ...


... so almost nobody dies.

On the other hand, the tighter the hospital capacity, the harder we have to work at social distancing to keep the overall death rate down to something less than atrocious.





Some model details

The mechanism of infection remains the same here as in the first model.

But now an infected person has a 19% chance of developing a “severe” case requiring hospitalization. (This number and the range of lethality rates are taken from Tomas Pueyo, Coronavirus: Why you must act now.)

The chance of severity is not evenly distributed across the population. People under age 20 are assumed never to have a severe case.

From age 20 to age 90 (the oldest the model lets anyone be), there’s a linear increase in the chance of developing a severe case. The rate at which that probability goes up is chosen to produce a 19% chance of a severe case, given the age structure of the model’s population before the virus strikes. In concrete terms, a 30-year-old who contracts an infection has a 9% chance of their infection being severe. For a 50-year-old it’s 27%, while for an 80-year-old it’s 54%.

The best case for the lethality of the disease seems to be 1% -- that is, if you develop the disease, there’s a 1% chance you’ll die. In countries where the medical system is overwhelmed, the lethality is more like 3% or 4%.

The model reflects that with the two terms “low-lethal” and “high-lethal”. As long as the number of severe cases remains below the hospital capacity, then the overall lethality of the disease is at the level defined by “low-lethal.” If the number of severe cases exceeds the hospital capacity, then the model calculates the number of these “excess” severe cases, and the higher the ratio of the “excess” to the total number of severe cases, the more the lethality of the disease approaches the level defined by “high-lethal.”

Because it is only severe cases that have an actual chance of dying, and because the severe cases in principle constitute 19% of all cases, the chance of dying is divided by 0.19 before being applied to individual severe cases to see whether they actually die.

A note on NetLogo
NetLogo is a relatively accessible platform for doing agent-based modeling, where you set up a world in a computer by defining the behaviors of the many individual "agents" operating in the world, then you turn it on and see what happens. You tweak the rules of behavior for your individual agents, and you see how that changes the behavior of the world as a whole.

The program is a free download (though they request registration) from their home page at http://www.ccl.sesp.northwestern.edu/netlogo/.

If you've done coding in other languages, you'll probably find it not too hard to learn NetLogo's code.

Even if you're new to coding, you can open up the program, choose a model from the "Models Library", and play around with it (look under the "File" tab).

Or you can download a model, like the one used to produce these data, available at https://drive.google.com/file/d/17a5l1T801mN24PamiBiuINbdBhSyXVno/view?usp=sharing.

Once you have NetLogo on your computer, if you double-click a NetLogo file, it will automatically open the software and the particular program as well.

In most models, you can click "setup" and then click "go" and just see what happens.

Then you can read the "Info" tab to see what you're doing.


As you get more adventuresome, you can turn to the "Code" tab and see the guts of the thing.

Enjoy!

2 comments:

  1. As a biologist, I am fascinated looking at this from the perspective of natural selection (muli-level selection), and how we humans ar trying to do a sort of end-run around NS.

    ReplyDelete
  2. Interesting thought, but then a lot of things we do can be seen as end-runs around natural selection?

    Why don't we have biological immunity to typhus? Because public sanitation keeps our exposure to it sufficiently rare that there's very little selective pressure in favor of such immunity.

    Through a broader lens, all of human society is one big middle finger raised in the face of natural selection.

    Why are humans able to survive who don't know how to grow or hunt food, don't know how to build a shelter, don't know how to make clothing?

    Because we live in societies where we split up the jobs, and only a few of us are needed to the existentially necessary tasks for the whole population.

    (Granted, that's a bit of a cheat, since these skills are things that in principle anyone can learn, rather than us having evolved into specialized sub-species.)

    ReplyDelete