Learn R Programming

gtcorr (version 0.2-1)

gtcorr.matrix: Calculate the efficiency of matrix group testing procedures for rectangular, diagonal, and random arrangements

Description

‘gtcorr.matrix’ calculates the efficiencies of matrix group testing procedures for rectangular, diagonal, and random arrangements, allowing for correlation between units and test error.

Usage

gtcorr.matrix(r, c, m = 1, p, sigma = 0, se = 1, sp = 1, r.prime, c.prime, arrangement = c("rectangular", "diagonal", "random"), model = c("beta-binomial", "Madsen", "Morel-Neerchal"), ...)

Arguments

r
number of rows in the pooling matrix.
c
number of columns in the pooling matrix.
m
cluster size.
p
probability of a unit testing positive.
sigma
pairwise correlation of two units in a cluster.
se
sensitivity. The probability that a pool of units tests positive given than at least one unit in that pool is positive
sp
specificity. The probability that a pool of units tests negative given that at least one unit in that pool is negative
r.prime
for a ‘rectangular’ arrangement, the number of rows in a rectangular cluster.
c.prime
for a ‘rectangular’ arrangement, the number of columns in a rectangular cluster.
arrangement
how clusters are arranged. Should be ‘rectangular’, ‘diagonal’ or ‘random’.
model
probability model for clusters. Should be ‘beta-binomial’, ‘Madsen’, or ‘Morel-Neerchal’.
...
runs
for a random arrangement, number of Monte Carlo simulations to perform to calculate the probability of a pool having no positive units. Default is 1000.

Value

r
c
m
cluster size.
r.prime
number of rows in the pooling matrix.
c.prime
number of columns in the pooling matrix.
param.grid
a data frame containing the values of p, sigma, se, and sp for each value of efficiency.
arrangement
arrangement.
model
model.
efficiency
a vector of efficiencies, one for each row of param.grid.

Details

One of m, p, sigma, se, or sp can have more than one value. For a diagonal arrangement, r, c, and m should be equal. For a rectangular arrangement, m should be r.prime*c.prime. See Lendle et. al. 2011 for more information.

References

Samuel D. Lendle, Michael Hudgens, and Bahjat F. Qaqish, "Group Testing for Case Identification with Correlated Responses" Submitted 2011. Biometrics.

See Also

gtcorr.matrix.user

Examples

Run this code
##Plot efficiencies of a 16 by 16 matrix procedure by arrangement
sigma <- seq(0,.99, length.out=100)
sig2 <- seq(0, .99, length.out=10)
diag <- gtcorr.matrix(r=16, c=16, m=16, r.prime=1, c.prime=16,
                      arr='diag', p=.05, sigma=sigma)$efficiency
rand <- gtcorr.matrix(r=16, c=16, m=16, r.prime=1, c.prime=16,
                      arr='rand', p=.05, sigma=sig2)$efficiency 
rect1 <- gtcorr.matrix(r=16, c=16, m=16, r.prime=1, c.prime=16, p=.05,
                       sigma=sigma)$efficiency 
rect2 <- gtcorr.matrix(r=16, c=16, m=16, r.prime=2, c.prime=8, p=.05,
                       sigma=sigma)$efficiency 
rect3 <- gtcorr.matrix(r=16, c=16, m=16, r.prime=4, c.prime=4, p=.05,
                       sigma=sigma)$efficiency 

plot(sigma, diag, ylim=c(0, max(diag)), type='l', ylab="Efficiency", xlab="sigma")
lines(sig2, rand, col=2)
lines(sigma, rect3, col=3)
lines(sigma, rect2, col=4)
lines(sigma, rect1, col=5)
legend("bottomleft", c("Diagonal", "Random", "4x4 rect.", "2x8 rect.",
                       "1x16 rect."), lty=1, col=1:5) 

Run the code above in your browser using DataLab