R/opCharMethodFunctions.R
IndProb.Rd
Extract the individual probabilities from objects of class
"opchar" returned by operatingCharacteristics1
(opChar1)
or operatingCharacteristics2
(opChar2).
IndProb(object, ...)
Either p.vec, the sorted vector of individual probabilities
(for hierarchical group testing algorithms) or p.mat, the sorted
matrix of individual probabilities in gradient arrangement (for array
testing algorithms). Further details are given under the 'Details' section
for the operatingCharacteristics1
(opChar1)
or operatingCharacteristics2
(opChar2) functions.
config.mat <- matrix(data = c(rep(1, 10), 1:10),
nrow = 2, ncol = 10, byrow = TRUE)
res1 <- opChar1(algorithm = "D2", p = 0.05, Se = 0.99, Sp = 0.99,
hier.config = config.mat)
#>
#> Number of minutes running: 0
#>
IndProb(res1)
#> [1] 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05
config.mat <- matrix(data = c(rep(1, 20), rep(1, 10), rep(2, 10),
rep(c(1, 2, 3, 4), each = 5),
rep(1, 3), rep(2, 2), rep(3, 3),
rep(4, 2), rep(5, 3), rep(6, 2),
rep(7, 3), rep(8, 2), 1:20),
nrow = 5, ncol = 20, byrow = TRUE)
Se <- matrix(data = rep(0.95, 10), nrow = 2, ncol = 5,
dimnames = list(Infection = 1:2, Stage = 1:5))
Sp <- matrix(data = rep(0.99, 10), nrow = 2, ncol = 5,
dimnames = list(Infection = 1:2, Stage = 1:5))
res2 <- opChar2(algorithm = "ID5",
alpha = c(18.25, 0.75, 0.75, 0.25),
Se = Se, Sp = Sp, hier.config = config.mat)
#>
#> Number of minutes running: 0
#>
IndProb(res2)
#> 1 2 3 4 5 6 7 8
#> 00 9.823e-01 0.975000 0.972100 0.971300 0.965400 0.96000 9.402e-01 0.935900
#> 10 1.072e-02 0.002383 0.003461 0.006162 0.016610 0.01073 1.045e-02 0.006992
#> 01 7.018e-03 0.020260 0.017850 0.002381 0.003716 0.02621 4.930e-02 0.055970
#> 11 7.081e-07 0.002310 0.006601 0.020190 0.014290 0.00301 4.435e-05 0.001105
#> 9 10 11 12 13 14 15 16
#> 00 0.933500 0.930400 0.92390 0.918500 9.150e-01 0.905000 0.8931000 0.88750
#> 10 0.023290 0.045030 0.01421 0.028830 3.605e-02 0.009667 0.0766600 0.01287
#> 01 0.034070 0.018470 0.04475 0.048250 4.897e-02 0.016530 0.0299900 0.07005
#> 11 0.009114 0.006096 0.01717 0.004427 3.375e-06 0.068800 0.0003022 0.02959
#> 17 18 19 20
#> 00 0.8792000 0.876000 0.7799000 0.741300
#> 10 0.1032000 0.076680 0.0052100 0.031930
#> 01 0.0172400 0.003444 0.2139000 0.224700
#> 11 0.0004045 0.043840 0.0009579 0.002132