Coder Social home page Coder Social logo

quartzsoftwarellc / qaverted Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 43 KB

Calculate the number of averted events based on a change in vaccine effectiveness.

Home Page: https://surveillance.shinyapps.io/qaverted/

License: Other

R 100.00%
epi shiny

qaverted's Introduction

QAverted

Installation

remotes::install_github("QuartzSoftwareLLC/qaverted")

Usage

Use the qaverted function to run find the number of averted events based on the Averted Formula derived below.

Variable Description
$A$ Events Averted
$E$ Current Vaccine Effectiveness
$E_n$ New Vaccine Effectiveness
$I_v$ Incidence in vaccinated population
$u$ Vaccine uptake

$$I_v = \frac{(1 - E) * u * I}{1 - u + u * (1 - E)} $$

$$ A = (1 - \frac{1 - E_n}{1 - E})* I_v$$

qaverted(0.6, 0.7, 0.5, 1e6)

Prevention Derivation

Using unvaccinated attack $A_{uv}$ and vaccinated attack rate $A_v$, we can calculate vaccine efficacy $E$.

$$E = \frac{A_{uv} - A_v}{A_{uv}}$$

Which can be simplified to

$$ E = 1 - \frac{A_v}{A_{uv}}$$

Attack rate ($A$) can be calculated from incidence ($I$) and population ($P$):

$$A = I / P$$

Furthermore vaccinated population ($P_v$) and unvaccinated population ($P_{uv}$) can be calculated using total population ($P$) and vaccine uptake $u$.

$$P_v = P * u$$

$$P_{uv} = P * (1 - u)$$

Consequently,

$$E = 1 - \frac{I_v}{P*u} / \frac{I_{uv}}{P (1 - u)}$$

$I_{uv}$ can be calculated as the difference between total incidence ($I$) and vaccinated incidence ($I_v$)

$$E = 1 - \frac{I_v}{P*u} / \frac{I - I_{v}}{P (1 - u)}$$

Solving for ($I_v$)

$$I_v = \frac{(1 - E) * u * I}{1 - u + u * (1 - E)} $$

After solving for ($I_v$) we calculate the number of cases in the vaccinated population if efficacy were 0 ($I_{E0}$)

$$ I_{E0} = \frac{I_v}{1 - E} $$

Next we calculate the number of predicted cases ($I_n$) at the new efficacy provided ($E_n$)

$$ I_n = I_{E0} * (1 - E_n) $$

Lastly we take the difference between ($I_n$) and ($I_v$) to calculate the change in incidence ($I_{\Delta}$)

$$I_{\Delta} = I_n - I_v$$

This simplifies further to

$$I_{\Delta} = I_{E0} * (1 - E_n) - I_v$$

Expanding $I_{E0}$

$$I_{\Delta} = \frac{I_v}{1 - E} * (1 - E_n) - I_v$$

Rearranging

$$I_{\Delta} = \frac{1 - E_n}{1 - E} * I_v - I_v$$

Factoring out $I_v$

$$I_{\Delta} = \frac{1 - E_n}{1 - E} * I_v - I_v$$

$$I_{\Delta} = (\frac{1 - E_n}{1 - E} - 1)* I_v$$

Lastly we can calculate events averted ($A$) by multiplying $I_\Delta$ by $-1$.

$$ A = - I_\Delta$$

$$ A = (1 - \frac{1 - E_n}{1 - E})* I_v$$

This leaves us with two final formulas required to calculate number averted ($A$)

$$ A = (1 - \frac{1 - E_n}{1 - E})* I_v$$

$$I_v = \frac{(1 - E) * u * I}{1 - u + u * (1 - E)} $$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.