# NOT RUN {
# Example 1: FIS provides the smallest mean
# number of tests and the smallest standard
# deviation. 2SIS has slightly larger mean
# and standard deviation than FIS, but
# its performance is comparable, indicating
# 2SIS may be preferred because it is
# easier to implement.
set.seed(1231)
p.vec1 <- rbeta(n = 8, shape1 = 1, shape2 = 10)
save.it1 <- Sterrett(p = p.vec1, Sp = 0.90, Se = 0.95)
save.it1$mean.sd
# Example 2: One individual is "high risk" and
# the others are "low risk". Since there is
# only one high-risk individual, the three
# informative Sterrett procedures perform
# similarly. All three informative Sterrett
# procedures offer large improvements over
# Dorfman testing.
p.vec2 <- c(rep(x = 0.01, times = 9), 0.5)
save.it2 <- Sterrett(p = p.vec2, Sp = 0.99, Se = 0.99,
cond.prob.plot = TRUE)
save.it2$mean.sd
# Example 3: Two individuals are at higher
# risk than the others. All three informative
# Sterrett procedures provide large
# improvements over Dorfman testing.
# Due to the large initial group size, an
# algorithm (described in the Appendix of
# Bilder et al. (2010)) is used for FIS.
# The Sterrett() function does this
# automatically for I>12.
p.vec3 <- c(rep(x = 0.01, times = 98), 0.1, 0.1)
save.it3 <- Sterrett(p = p.vec3, Sp = 0.99, Se = 0.99)
save.it3$mean.sd
# }
Run the code above in your browser using DataLab