Package: vaccine-stats-ohio
Vaccine-Stats-OhioVaccine-Stats-Ohio is a Python library for accessing and summarizing Ohio COVID vaccine statistics.DisclaimerThe content provided in this module is for educational purposes only. It is not intended to substitute for professional medical advice, diagnosis, or treatment. Effort was made to ensure data accuracy and reliability, however no guarantee can be made to this effect.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.InstallationUse the package managerpipto install.pipinstallvaccine-stats-ohioUsageInitialize dataTo get started, import theVax_Statsclass and initialize it. Vaccine statistics are automatically downloaded from theOhio Department of Health websiteand stored in a temporary file.fromvaccine_statsimportVax_StatswithVax_Stats()asdata:...Note that you may also want to import the date class, as it is used frequently in data lookups.fromdatetimeimportdateFind the latest date for which data is publishedODH updates their data approximately daily. You can use theodh_latestfunction to determine what day the latest data is for. Note that data for the current day is usually incomplete, therefore it is wise to look back at least a day or two for accurate statistics.withVax_Stats()asdata:latest_date=data.odh_latest()print(latest_date)# Output: 2021-02-23Look up vaccination dataVaccine data can be browsed by county and date using thelookupfunction. Statistics are returned as a tuple of integers mirroring the ODH data file. The first item is the number of vaccines started (i.e., the number of people who got their first dose) and the second item is the number of vaccines completed (i.e., the number of people who got their second dose). It is unclear how results will be reported if a vaccine that only requires one dose is distributed (we can cross that bridge when we get to it).By default, data is returned cumulatively for all counties up through the current date.withVax_Stats()asdata:n=data.lookup()print(n)# Output: (1474872, 707396)# There were 1.47 million vaccination series started, with 0.71 million having been completed, in the state of Ohio as of the date this was run.Data can also be returned for inidividual counties and/or through a past date.withVax_Stats()asdata:n=data.lookup(county="Cuyahoga",date=date(2021,2,1))print(n)# Output: (94757, 24969)# There were a total of 95k vaccination series started, with 25k having been completed, in Cuyahoga county as of February 1, 2021.Data can also be displayed for an individual date (not cumulatively) using thecumulative=Falseargument.withVax_Stats()asdata:n=data.lookup(county="Cuyahoga",date=date(2021,2,1),cumulative=False)print(n)# Output: (2065, 2804)# There were 2,065 first vaccines and 2,804 second vaccines given in Cuyahoga county on February 1, 2021.See changes over timeThedeltafunction takes two dates and returns a tuple in the same format as thelookupfunction, but with numbers indicating the percent change incumulativevaccinations between two dates.withVax_Stats()asdata:p=data.delta(back_date=date(2021,2,7),front_date=date(2021,2,14))print(p)# Output: (18.4, 48.6)# There were 18.4% more vaccination series started and 48.6% more vaccination series completed on February 14 compared to a week prior.Thedeltafunction can also output raw vaccination numbers instead of percentages using thepercent=Falseargument.withVax_Stats()asdata:n=data.delta(back_date=date(2021,2,7),front_date=date(2021,2,14),percent=False)print(n)# Output: (208761, 162962)# There were 209k more vaccination series started and 163k more vaccination series completed on February 14 compared to a week prior.Thedeltafunction also takescountyas an argument, defaulting tocounty="All".Find the percentage of the population that has been vaccinatedThe percentage of the population that has been vaccinated can be found using thepercent_vaccinatedfunction. This defaults to showing the current totals for all counties. The function can be customized using thecountyanddatearguments as per above.withVax_Stats()asdata:p=data.percent_vaccinated()print(p)# Output: 6.1# A total of 6.1% of Ohio's population has completed their COVID vaccine series as of the date the program was run.Data can also be displayed based on the number of people who received at least one dose of the vaccine rather than just those who have completed a vaccination series using thefully_vaccinated=Falseargument.withVax_Stats()asdata:p=data.percent_vaccinated(fully_vaccinated=False)print(p)# Output: 12.6# A total of 12.6% of Ohio's population has received at least one COVID vaccine as of the date the program was run.Predict when herd immunity will be reachedThepredict_herd_immunityfunction attempts to estimate a date at which herd immunity will be significantly reached based on current vaccination trends.CautionThis function makes a number of assumptions that must be carefully considered.Ther_0(r0) argument defaults to 6.5. This is based on reports from medical literature and the media in the context of the now-predominant delta variant.1,2The use of r0is inherently flawed because if assumes a completely susceptible population.3In other words, it does not account for individuals becoming less susceptible due to previous infection or vaccination. Previous estimates of r0also do not account for changes in transmissibility due to emerging vaccine variants.The model currently assumes that a complete vaccination with a booster confers 93% protection against COVID-19 (booster_efficacy=0.93), complete vaccination without a booster confers 48% protection (full_efficacy=0.48), and a single dose confers 10% protection (started_efficacy=0.1).4,5The efficacy of a single dose has not been studied in the context of the predominant delta variant, so this number is a guess. The model does not take into account the time it takes for immunity to be reached after vaccination and does not account for immunity waning over time.The model calculates the rate at which people are being vaccinated using thedeltafunction and extrapolates this into the future assuming a linear vaccination rate. In reality, vaccination rates may be nonlinear or otherwise fluctuate based on a number of factors including product availability, emergency use authorization of novel vaccines, and prevailing attitudes towards vaccination.Because data is analyzed in aggregate for the state of Ohio, the assumption is that vaccination pravalence and incidence are homogenous across the state. This is not the case. Because of differences in geographic vaccination rates, many areas may see herd immunity slower than predicted.Because of these limitations, output from this function should be viewed with a high degree of skepticism. It constitutes a best effort attempt at predicting when herd immunity will be reached, but with a high degree of variability that is itself difficult to quantify. See Disclaimer above.withVax_Stats()asdata:d=data.predict_herd_immunity()print(d)# Output: 2022-01-13# The predicted immunity date is January 13, 2022 as of the date the program was run.ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.LicenseThis software is licensed under theMIT License.ReferencesKang M, Xin H, Yuan J, et al. Transmission Dynamics and Epidemiological Characteristics of Delta Variant Infections in China.Epidemiology. 2021.https://www.npr.org/sections/goatsandsoda/2021/08/11/1026190062/covid-delta-variant-transmission-cdc-chickenpoxhttps://coronavirus.ohio.gov/wps/portal/gov/covid-19/resources/news-releases-news-you-can-use/basic-reproduction-number-pop-up-sitesDelamater PL, Street EJ, Leslie TF, Yang YT, Jacobsen KH. Complexity of the Basic Reproduction Number (R0).Emerging Infectious Diseases. 2019;25(1):1–4.Tartof SY, Slezak JM, Fischer H, et al. Effectiveness of mRNA BNT162b2 COVID-19 vaccine up to 6 months in a large integrated health system in the USA: a retrospective cohort study.The Lancet. Published online October 2021:S0140673621021838.