Title: | Estimate the Unit-Wide Probability of COVID-19 |
---|---|
Description: | We propose a method to estimate the probability of an undetected case of COVID-19 in a defined setting, when a given number of people have been exposed, with a given pretest probability of having COVID-19 as a result of that exposure. Since we are interested in undetected COVID-19, we assume no person has developed symptoms (which would warrant further investigation) and that everyone was tested on a given day, and all tested negative. |
Authors: | Eric Brown [aut, cre] , Wei Wang [ctb] |
Maintainer: | Eric Brown <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2024-11-04 05:34:42 UTC |
Source: | https://github.com/eebrown/covidprobability |
Calculates the pretest probability over time, assuming the individual does not develop symptoms, by taking into account the distribution of incubation periods (defined as the time from exposure to symptom onset).
adjust_pretest(pre0, asympt, days = 14, mu = 1.63, sigma = 0.5)
adjust_pretest(pre0, asympt, days = 14, mu = 1.63, sigma = 0.5)
pre0 |
Initial pretest probability (on day of exposure) |
asympt |
The proportion of positive patients who would be expected not to ever develop symptoms (true asymptomatic patients). |
days |
Days since exposure for calculation range |
mu |
The mean of a lognormal distribution that approximates the incubation period for COVID-19. E.g. 1.63 (see reference). |
sigma |
The standard deviation of a lognormal distribution that approximates the incubation period for COVID-19. E.g. 0.5 (see reference). |
pretest probability by day (time series)
See McAloon et al. https://bmjopen.bmj.com/content/10/8/e039652/
Calculate posttest probability from pretest probability and test characteristics
calc_postest_prob(pretest_prob, sens, spec)
calc_postest_prob(pretest_prob, sens, spec)
pretest_prob |
Pretest probability |
sens |
Test sensitivity |
spec |
Test specificity |
posttest probability
The probability that an individual has COVID-19 will change over time as new information is gleaned. The initial probability is the pretest probability (pre0) associated with the nature of the interaction/exposure. This probability will decrease with each passing day that the individual does not develop symptoms. When a test is done, the probability is the posttest probability; this reduces the probability based on the test characteristics at the time of testing. Subsequently, the probability will continue to decrease with each passing day that no symptoms develop. This function returns a time series including those 3 phases.
individual_probability(test_day, pre0, sens, spec, asympt, days, mu, sigma)
individual_probability(test_day, pre0, sens, spec, asympt, days, mu, sigma)
test_day |
Day of PCR test (days since exposure) |
pre0 |
Pre-test probability of person on day of exposure |
sens |
A vector of sensitivities by day since exposure |
spec |
The specificity of the PCR test |
asympt |
The proportion of infected patients expected to remain asymptomatic throughout the course of infection |
days |
Days since exposure for calculation range |
mu |
The mean of a lognormal distribution that approximates the incubation period for COVID-19. E.g. 1.63 (see reference). |
sigma |
The standard deviation of a lognormal distribution that approximates the incubation period for COVID-19. E.g. 0.5 (see reference). |
A time series of probabilities
Given an initial pretest probability, and assuming symptoms never arise, with each passing day the pretest probability will be lower, given the person did not experience symptoms. This returns a vector of posttest probabilities which takes all of the above into account, assuming a negative test on each day. Note this is not a time series, and does not reflect if serial testing were done each day and assumes testing was only done once.
posttest_series(pre0, asympt, days = 14, mu = 1.63, sigma = 0.5, sens, spec)
posttest_series(pre0, asympt, days = 14, mu = 1.63, sigma = 0.5, sens, spec)
pre0 |
The pretest probability on day 0 (at exposure) |
asympt |
The proportion of infected patients expected to remain asymptomatic throughout the course of infection |
days |
Days since exposure for calculation range |
mu |
The mean of a lognormal distribution that approximates the incubation period for COVID-19. E.g. 1.63 (see reference). |
sigma |
The standard deviation of a lognormal distribution that approximates the incubation period for COVID-19. E.g. 0.5 (see reference). |
sens |
A vector of sensitivities by day since exposure |
spec |
The test specificity |
A vector of posttest probabilities
For an event that occurs with probability p, this function returns the probability of an occurrence given n repetitions. p is numeric and can be a vector.
probability_any(n, p)
probability_any(n, p)
n |
The number of times to repeat the event (independent) |
p |
The individual probability of the event happening |
The probability that any event p occurs with n repetitions is equal to the
reciprocal of the probability that p never occurs. The probability that p
never occurs with n repetitions is (1 - p) ^ n
. Thus, the probability
that any event p occurs after n repetitions is 1 - ( (1 - p) ^ n )
.
The probability of an event with the specified probability, after n repetitions
probability_any(1, 0.5) probability_any(2, 0.5) probability_any(2, c(0.5, 1/3, 0.25))
probability_any(1, 0.5) probability_any(2, 0.5) probability_any(2, c(0.5, 1/3, 0.25))
Every day, a certain number of people are expected to show symptoms, based on the incubation period. This would typically lead to further investigation and ongoing suspicion of an outbreak. This function calculates the proportion of individuals on a given day that would not be expected to have developed symptoms yet. So if no one has developed symptoms, this proportion of people could still have undetected COVID-19.
prop_remaining(t, asympt, mu = 1.63, sigma = 0.5)
prop_remaining(t, asympt, mu = 1.63, sigma = 0.5)
t |
day |
asympt |
The proportion of positive patients who would be expected not to ever develop symptoms (true asymptomatic patients). |
mu |
The mean of a lognormal distribution that approximates the incubation period for COVID-19. E.g. 1.63 (see reference). |
sigma |
The standard deviation of a lognormal distribution that approximates the incubation period for COVID-19. E.g. 0.5 (see reference). |
Proportion who would not be expected to show symptoms yet
See McAloon et al. https://bmjopen.bmj.com/content/10/8/e039652/
COVID-19 PCR sensitivity by days since exposure
sens
sens
A data frame with 21 rows and 3 variables:
point estimate of sensitivity
lower 95% confidence interval of sensitivity
upper 95% confidence interval of sensitivity
https://github.com/HopkinsIDD/covidRTPCR
To calculate the probability that any asymptomatic person has COVID-19,
this function treats each person/exposure as independent events and
calculates the probability time series using the individuals time series from
individual_probability()
.
unit_probability(test_day, pre0, sens, spec, asympt, days, mu, sigma, n)
unit_probability(test_day, pre0, sens, spec, asympt, days, mu, sigma, n)
test_day |
Day of PCR test (days since exposure) |
pre0 |
Pre-test probability of person on day of exposure |
sens |
A vector of sensitivities by day since exposure |
spec |
The specificity of the PCR test |
asympt |
The proportion of infected patients expected to remain asymptomatic throughout the course of infection |
days |
Days since exposure for calculation range |
mu |
The mean of a lognormal distribution that approximates the incubation period for COVID-19. E.g. 1.63 (see reference). |
sigma |
The standard deviation of a lognormal distribution that approximates the incubation period for COVID-19. E.g. 0.5 (see reference). |
n |
Number of exposed individuals |
The probability of an event with the specified probability, after n repetitions