# Testing in parallel or series

This utility calculates the overall sensitivity and specificity of the testing regimen when two tests of known sensitivity and specificity are used together, either in parallel or in series. Calculations assume that the two tests are independent, conditional on disease status (that is, sensitivity [specificity] for one test remains the same, regardless of the result of the other test.

No example available
No references available
```				######################################
# Program to calculate Se and Sp for 2 tests in parallel and series
######################################

rm(list = ls())
test<- ifelse(length(commandArgs()) < 3, TRUE, FALSE)
fpath<- ifelse(test, "webRootUrl", "rtoolsPath")

source(paste(fpath, "R/HTMLStream.R", sep = ""))
source(paste(fpath, "R/epitools_functions.r", sep = ""))

# extract command arguments
a1<- a0[8:13]

# cat(a0)
# cat(a1)
digits<- 4
test1<- a1
test2<- a1
Se1<- type.convert(a1)
Sp1<- type.convert(a1)
Se2<- type.convert(a1)
Sp2<- type.convert(a1)
dim(a1)<- c(3, 2)
a1<- t(a1)
colnames(a1)<- c("Test", "Sensitivity", "Specificity")
results<- array(0, dim = c(2, 4))
rownames(results)<- c("Sensitivity", "Specificity")
colnames(results)<- c(test1, test2, "Parallel", "Serial")

results[,1:2]<- type.convert(t(a1[,2:3]))
results[1,3]<- 1 - (1 - Se1)*(1 - Se2)
results[1,4]<- Se1*Se2
results[2,3]<- Sp1*Sp2
results[2,4]<- 1 - (1 - Sp1)*(1 - Sp2)

results<- formatC(results, format = "f", digits = digits)

# write to html and file
# cat(test)
heading<- "Sensitivity and specificity for two tests in parallel or series"