Type Package
Title Quantitative Pooled Testing
Version 0.2.3
Date "r Sys.Date()
"
Authors Wanning Su, Tao Liu
Maintainer Wanning Su (wanning_su@brown.edu)
Description This package implements pooled testing with quantitative assays.
License MIT
URL https://github.com/whitneysu/QuantitativePooledTesting
Depends R (>= 3.2.0)
LazyData true
empirical cdf calculation
Generates an empirical cdf for quantitative pooled testing
ecdf_pool(v, N = length(v), cutoff = max(v), ...)
- v the numeric vector of the observations for calculating ecdf.For quantitative pooling strategies, only CDF on the support of v<cutoff is needed.
- N the number of observations.
- cutoff cutoff value of the quantitative assay that defines test positivity.
a list of two items: (1) a matrix and (2) a numeric value. The matrix has 3 columns: the support consisting of values of such that v < cutoff, the empirical PMF, and the empirical CDF. The second item in the list output is a numeric value that represents the proportion of total observations that are less than cutoff value v.
Wanning Su (wanning_su@brown.edu), Tao Liu, Joseph Hogan
Liu T, Hogan JW, Daniels MJ, et al. (2017). "Improved HIV-1 viral load monitoring capacity using pooled testing with marker-assisted deconvolution." J Acquir Immune Defic Syndr 75(5):580-587.
ecdf_pool(round(runif(100, 0, 20)), cutoff = 18)
Create a ecdf class for ecdf_pool function output
Create an ecdf class object.
to_ecdf_class(x)
- x Output object from the \code{ecdf_pool()} function
An object of class ecdf
Wanning Su (wanning_su@brown.edu), Tao Liu, Joseph Hogan
Liu T, Hogan JW, Daniels MJ, et al. (2017). "Improved HIV-1 viral load monitoring capacity using pooled testing with marker-assisted deconvolution." J Acquir Immune Defic Syndr 75(5):580-587.
to_ecdf_class(ecdf_pool(round(runif(100, 0, 20)), cutoff = 18))
convoluting two empirical distributions
This function calculates the convolution of two empirical distributions up to the value of \code{cutoff} (on the sum of two random variables).
convol.dens(ecdf1, ecdf2, N1, N2, cutoff)
- ecdf1 An ecdf that is the matrix output object from the function \code{convol.dens()} itself or from the function \code{ecdf_pool()}.
- ecdf2 An ecdf that is the matrix output object from the function \code{convol.dens()} itself or from the function \code{ecdf_pool()}.
- N1 The size of the empirical support of \code{ecdf1}.
- N2 The size of the empirical support of \code{ecdf2}.
- cutoff Cutoff of the support of the resulting convolution distribution.
Returns a list of two items: (1) a matrix and (2) a numeric value. The matrix has 3 columns: the support consisting of values of such that v < cutoff, the empirical PMF, and the empirical CDF. The second item in the list output is a numeric value that represents the proportion of total observations that are less than cutoff value v.
Wanning Su (wanning_su@brown.edu), Tao Liu, Joseph Hogan
Liu T, Hogan JW, Daniels MJ, et al. (2017). "Improved HIV-1 viral load monitoring capacity using pooled testing with marker-assisted deconvolution." J Acquir Immune Defic Syndr 75(5):580-587.
ecdf1 <- ecdf_pool(round(runif(100, 0, 20)), cutoff = 18)$out ecdf2 <- ecdf_pool(round(runif(100, 0, 20)), cutoff = 17)$out cutoff <- 18 convol.dens(ecdf1, ecdf2, N1, N2, cutoff)
Intermediate Function used by MPA
This function allows you to compute the calculate the ATR for MPA for a range of pool sizes (from 2 to pool size specified)
foo_atr(v, N = length(v), max_K = 5, cutoff = 1000, quietly = TRUE)
- v the numeric vector of the observations for calculating ecdf.For quantitative pooling strategies, only CDF on the support of v<cutoff is needed.
- N the number of observations.
- cutoff cutoff value of the quantitative assay that defines test positivity.
- max_K Maximum pool size that is under consideration.
- quietly Logical value; whether the results print to screen or not.
Returns a three column matrix of 1)pool size, 2)convolution CDF, and the 3)ATR for MPA.
Wanning Su (wanning_su@brown.edu), Tao Liu, Joseph Hogan
Liu T, Hogan JW, Daniels MJ, et al. (2017). "Improved HIV-1 viral load monitoring capacity using pooled testing with marker-assisted deconvolution." J Acquir Immune Defic Syndr 75(5):580-587.
v = c(200, 1500, 1900, 800, 950) max_K = 9 cutoff = 2000 foo_atr(v, N = length(v), max_K, cutoff, quietly = TRUE)
ATR required by MiniPooling(MP)
This function calculates the ATR needed by MP for a range of pool sizes (from 2 to a pool size specified).
mp_atr(v, N = length(v), max_K = 5, cutoff = 1000, quietly = TRUE)
- v the numeric vector of the observations for calculating ecdf.For quantitative pooling strategies, only CDF on the support of v<cutoff is needed.
- N the number of observations.
- cutoff cutoff value of the quantitative assay that defines test positivity.
- max_K Maximum pool size that is under consideration.
- quietly Logical value; whether the results print to screen or not.
The function returns a matrix of two columns: The pool size from 2:max_K and the Average Tests Required by MP given that pool size (MP_ATR).
Wanning Su (wanning_su@brown.edu), Tao Liu, Joseph Hogan
Liu T, Hogan JW, Daniels MJ, et al. (2017). "Improved HIV-1 viral load monitoring capacity using pooled testing with marker-assisted deconvolution." J Acquir Immune Defic Syndr 75(5):580-587.
v = c(200, 1500, 1900, 800, 950) max_K = 9 cutoff = 2000 mp_atr(v, N = length(v), max_K, cutoff, quietly = TRUE)
ATR required by MPA
This function calculates the ATR needed by MP for a range of pool sizes (from 2 to a pool size specified).
mpa_atr(v, N = length(v), max_K = 5, cutoff = 1000, quietly = TRUE)
- v the numeric vector of the observations for calculating ecdf.For quantitative pooling strategies, only CDF on the support of v<cutoff is needed.
- N the number of observations.
- cutoff cutoff value of the quantitative assay that defines test positivity.
- max_K Maximum pool size that is under consideration.
- quietly Logical value; whether the results print to screen or not.
The function returns a matrix of two columns: The pool size from 2:max_K and the Average Tests Required by MPA given that pool size (MPA_ATR).
Wanning Su (wanning_su@brown.edu), Tao Liu, Joseph Hogan
Liu T, Hogan JW, Daniels MJ, et al. (2017). "Improved HIV-1 viral load monitoring capacity using pooled testing with marker-assisted deconvolution." J Acquir Immune Defic Syndr 75(5):580-587.
v = c(200, 1500, 1900, 800, 950) max_K = 9 cutoff = 2000 mpa_atr(v, N = length(v), max_K, cutoff, quietly = TRUE)
ATR required by MMPA
This function calculates the ATR needed by MMPA for a range of pool sizes (from 2 to a pool size specified).
mmpa_atr(v, N = length(v), max_K = 5, cutoff = 1000, quietly = TRUE, s = )
- v the numeric vector of the observations for calculating ecdf.For quantitative pooling strategies, only CDF on the support of v<cutoff is needed.
- N the number of observations.
- cutoff cutoff value of the quantitative assay that defines test positivity.
- max_K Maximum pool size that is under consideration.
- quietly Logical value; whether the results print to screen or not.
- s Risk score that is used for ranked testing
The function returns a matrix of two columns: The pool size from 2:max_K and the Average Tests Required by MMPA given that pool size (MMPA_ATR).
Wanning Su (wanning_su@brown.edu), Tao Liu, Joseph Hogan
Liu T, Hogan JW, Daniels MJ, et al. (2017). "Improved HIV-1 viral load monitoring capacity using pooled testing with marker-assisted deconvolution." J Acquir Immune Defic Syndr 75(5):580-587.
v = c(200, 1500, 1900, 800, 950) max_K = 9 cutoff = 2000 s = c(5, 3, 1, 2, 4) mmpa_atr(v, s, max_K, cutoff = 2000, quietly = TRUE)
devtools::check_win_devel()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.