Performs a generalized McNemar's test to jointly compare sensitivity and specificity.
References
Lachenbruch P.A., Lynch C.J. (1998). Assessing screening tests: extensions of McNemar's test. Stat Med, 17(19): 2207-17.
Examples
# Example 1:
data(Paired1) # Hypothetical study data
ftable(Paired1)
#> y2 0 1
#> d y1
#> 0 0 155 22
#> 1 53 31
#> 1 0 32 22
#> 1 78 319
paired.layout1 <- tab.paired(d=d, y1=y1, y2=y2, data=Paired1)
print(paired.layout1)
#> Two binary diagnostic tests (paired design)
#>
#> Test1: 'y1'
#> Test2: 'y2'
#>
#> Diseased:
#> Test1 pos. Test1 neg. Total
#> Test2 pos. 319 22 341
#> Test2 neg. 78 32 110
#> Total 397 54 451
#>
#> Non-diseased:
#> Test1 pos. Test1 neg. Total
#> Test2 pos. 31 22 53
#> Test2 neg. 53 155 208
#> Total 84 177 261
#>
sesp.gen.mcnemar(paired.layout1)
#> test.statistic p.value
#> 4.417333e+01 2.557894e-10
# Example 2 (from Lachenbruch and Lynch (1998)):
paired.layout2 <- read.tab.paired(
d.a = 850, d.b = 40, d.c = 60, d.d = 50,
nd.a = 60, nd.b = 25, nd.c = 15, nd.d = 900,
testnames = c("T1", "T2")
)
print(paired.layout2)
#> Two binary diagnostic tests (paired design)
#>
#> Test1: 'T1'
#> Test2: 'T2'
#>
#> Diseased:
#> Test1 pos. Test1 neg. Total
#> Test2 pos. 850 40 890
#> Test2 neg. 60 50 110
#> Total 910 90 1000
#>
#> Non-diseased:
#> Test1 pos. Test1 neg. Total
#> Test2 pos. 60 25 85
#> Test2 neg. 15 900 915
#> Total 75 925 1000
#>
sesp.gen.mcnemar(paired.layout2)
#> test.statistic p.value
#> 6.50000000 0.03877421