-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
78 lines (51 loc) · 2.15 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# R package: covidprobability
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)
<!-- badges: end -->
This package provides the functions, data and documentation that support a
calculator to determine the probability of an undetected COVID-19 infection in
a setting/unit after a potential exposure, testing, and when there are no
symptomatic cases. For a detailed explanation of the rationale and
implementation, please see the [vignette](https://eebrown.github.io/covidprobability/articles/unit-example.html).
## Shiny
An [interactive web app](http://covid.eebc.ca) of this calculator is available.
## Installation
You can install the latest CRAN version of covidprobability from with:
``` r
install.packages("covidprobability")
```
You can install the latest version of covidprobability from [Github](https://github.com/eebrown/covidprobability) with:
``` r
devtools::install.github("eebrown/covidprobability")
```
### Disclaimer
This is an exploratory model and may contain errors. Please see the [vignette](https://eebrown.github.io/covidprobability/articles/unit-example.html) for assumptions and limitations of the model. It should not be relied upon for clinical decisions.
## Example
```{r example}
library(covidprobability)
test_n <- unit_probability(test_day = 9, pre0 = 0.13, sens = sens, spec = 1,
asympt = 0.279, days = 14, mu = 1.63, sigma = 0.5,
n = 10)
```
```{r unit_example, echo = FALSE}
plot(1:14, test_n$point, type="b", ylim=c(0,1),
main = "Unit-wide probabiltiy of undetected COVID-19",
xlab = "Days since exposures",
ylab = "Probability")
lines(test_n$lower, type="l", col="grey")
lines(test_n$upper, type="l", col="grey")
abline(v = 9)
text(1:14, (test_n$point + 0.1), round(test_n$point, 2), cex = 1)
```