knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
{covidscreen} is an R package and Shiny app designed to help organizations evaluate their risk from COVID-19 and the potential benefits of regular asymptomatic testing.
You can install the development version of {covidscreen} from Github with:
if (!"remotes" %in% installed.packages()) install.packages("remotes") remotes::install_github("jesse-smith/covidscreen")
If you are using R on Windows, you will need to first install Rtools here.
library(covidscreen)
To run the Shiny app, you can use run_app()
or visit an online version.
To access the underlying model in R, you can use cs_dist()
with the desired parameters. Running with no inputs uses the defaults; the output is a data.table
:
# Create some data using default parameters data <- cs_dist() # Show data data
You can access the risk-based metrics used in the Shiny app using corresponding
functions in the R package. Undetected cases are calculated using
cs_undetected()
, relative risk reduction is calculated using cs_rr()
, and
cost effectiveness per test is calculated using cs_cost_eff()
.
# Cost effectiveness cs_undetected(data) # Relative risk reduction cs_rr(data) # Cost effectiveness cs_cost_eff(data)
Additionally, test performance metrics are included in the R package to facilitate analysis not performed in the Shiny app. These include:
cs_pos()
: the proportion of positive tests (out of the organization)cs_neg()
: the proportion of negative tests (out of the organization)cs_true_pos()
: the proportion of true positive tests (out of org)cs_true_neg()
: the proportion of true negative tests (out of org)cs_false_pos()
: the proportion of false positive tests (out of org)cs_false_neg()
: the proportion of false negative tests (out of org)cs_ppv()
: the positive predictive value of a testcs_npv()
: the negative predictive value of a testcs_fdr()
: the false discovery rate of a testcs_for()
: the false omission rate of a testcs_sens()
: the sensitivity (true positive rate, recall) of a testcs_spec()
: the specificity (true negative rate) of a testcs_fpr()
: the false positive rate of a testcs_fnr()
: the false negative rate of a test# Positive tests cs_pos(data) # Negative tests cs_neg(data) # True positives cs_true_pos(data) # True negatives cs_true_neg(data) # False positives cs_false_pos(data) # False negatives cs_false_neg(data) # Positive predictive value (precision) cs_ppv(data) # Negative predictive value cs_npv(data) # False discovery rate cs_fdr(data) # False omission rate cs_for(data) # True positive rate (sensitivity/recall) cs_sens(data) # True negative rate (specificity) cs_spec(data) # False positive rate cs_fpr(data) # False negative rate cs_fnr(data)
Please note that the {covidscreen} project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.