# Interactive Covid-19 population immunity estimates

I made a web app that estimates population immunity for SARS-CoV-19. Try it out at covid.mremington.co.

What follows is an overview of how the estimate works. Feel free to skip this post and just explore the site if you're not interested in the behind-the-scenes.

First, a crash course in population immunity:

### Why is population immunity important?

- Normal life may safely return when enough of the population has immunity to Covid-19, limiting further spread. This is known as "herd immunity". [1]
- Herd immunity may be achieved either through infection and recovery or by vaccination. [2]
- Besides protecting the individual, the goal of vaccination is for a population to reach herd immunity safely. [2]
- Herd immunity also protects those who are unable to be vaccinated, such as newborns and immunocompromised people, because the disease spread within the population is very limited. [2]

### How much of the population needs immunity?

- The herd immunity threshold (HIT) is debated among scientists. The commonly accepted herd immunity threshold for SARS-CoV-2 is 60-80%. [3] [1]
- A research group at the University of Oxford estimates the threshold at 10% to 60% when accounting for T cell immunity studies. [3]
- Another research group calculates the threshold at 10% to 20% when accounting for diversity in population mixing. Some consider this controversial. [3]
- Infections, hospitalizations, and related metrics may decline as population immunity rises, even if the HIT is not reached. [1]

**References**

- COVID-19 Vaccines and Herd Immunity ; Harvard Center for Communicable Disease Dynamics
- What Is Herd Immunity? | Infectious Diseases | JAMA | JAMA Network
- Covid-19: Do many people have pre-existing immunity? | The BMJ

To estimate population immunity we need to know:

1. The number of vaccinated people

2. The number of people who were infected and recovered

3. The overlap between these groups

For vaccinations my code simply pulls the data daily. You can choose that either the first or second dose be counted as immunity.

Determining recovered infections is more tricky. Cases only represent a fraction of known infections, since not all infected people get tested. Luckily Youyang Gu, one of the top Covid-19 modelers, has presented a simple equation for estimating true infections. To use this equation we need the daily percentage of positive tests and the daily number of new cases.

Many who get vaccinated have already been infected. It's impossible to know the exact overlap, but if we don't estimate it then our immunity estimate will be too high. One of the top modelers assumes 50% of vaccinations go to recovered infections. In my web app that is customizable, with a default of 20%. 28% of the US is estimated to have been infected as of March 7, 2021.

I also used SciPy to find the last peak in hospitalizations and report the estimated population immunity at that time. Note that this is not necessarily the HIT, as seasonality and other factors also affect transmission. **My model found that US hospitalizations began to decline from their all-time peak after January 12, 2021 when the estimated population immunity was 22.7%.**

Putting it all together, here is the complete web app, covid.mremington.co, as of March 7th, 2021:

The source code is available here.

Lastly, I was greatly inspired by Youyang Gu of covid19-projections.com, who built a similar model to estimate immunity.