Calculation of the expected value of the width of
confidence intervals for one proportion in group testing. Calculations
are available for the confidence interval methods in propCI
.
gtWidth(n, s, p, conf.level = 0.95, alternative = "two.sided", method = "CP")
integer specifying the number of groups. A vector of integers is also allowed.
integer specifying the common size of groups. A vector of integers is also allowed.
the assumed true proportion of individuals showing the trait to be estimated. A vector is also allowed.
the required confidence level of the interval.
character string specifying the alternative hypothesis, either "two.sided", "less", or "greater".
character string specifying the confidence
interval method. Available options include those in propCI
.
A matrix containing the columns:
the resulting total number of units, \(n*s\).
the number of groups.
the group size.
the assumed true proportion.
the expected value of the confidence interval width as defined under the argument alternative.
The two-sided (alternative="two.sided") option calculates the expected width between the lower and upper bound of a two-sided \(conf.level*100\) percent confidence interval. See Tebbs & Bilder (2004) for expression. The one-sided (alternative="less" or alternative="greater") options calculate the expected distance between the one-sided limit and the assumed true proportion p for a one-sided \(conf.level*100\) percent confidence interval.
Tebbs, J., Bilder, C. (2004). “Confidence interval procedures for the probability of disease transmission in multiple-vector-transfer designs.” Journal of Agricultural, Biological, and Environmental Statistics, 9, 75–90.
propCI
for confidence intervals in
group testing.
Other estimation functions:
designEst()
,
designPower()
,
gtPower()
,
gtTest()
,
propCI()
,
propDiffCI()
# Examine different group sizes to determine
# the shortest expected width.
gtWidth(n = 20, s = seq(from = 1, to = 200, by = 10),
p = 0.01, alternative = "less", method = "CP")
#> ns n s p expCIwidth
#> [1,] 20 20 1 0.01 0.144314249
#> [2,] 220 20 11 0.01 0.020459877
#> [3,] 420 20 21 0.01 0.013520195
#> [4,] 620 20 31 0.01 0.010890547
#> [5,] 820 20 41 0.01 0.009503989
#> [6,] 1020 20 51 0.01 0.008665159
#> [7,] 1220 20 61 0.01 0.008124800
#> [8,] 1420 20 71 0.01 0.007771843
#> [9,] 1620 20 81 0.01 0.007553342
#> [10,] 1820 20 91 0.01 0.007452126
#> [11,] 2020 20 101 0.01 0.007487536
#> [12,] 2220 20 111 0.01 0.007728727
#> [13,] 2420 20 121 0.01 0.008313282
#> [14,] 2620 20 131 0.01 0.009463048
#> [15,] 2820 20 141 0.01 0.011489335
#> [16,] 3020 20 151 0.01 0.014782427
#> [17,] 3220 20 161 0.01 0.019784901
#> [18,] 3420 20 171 0.01 0.026952691
#> [19,] 3620 20 181 0.01 0.036710802
#> [20,] 3820 20 191 0.01 0.049411254
# Calculate the expected width of the confidence
# interval with a group size of 1 (individual testing).
gtWidth(n = 20, s = 1, p = 0.005, alternative = "less", method = "CP")
#> ns n s p expCIwidth
#> n 20 20 1 0.005 0.141759