Skip to contents

Performs a McNemar Test for comparison of sensitivities and specificities of two binary diagnostic tests in a paired study design.

Usage

sesp.mcnemar(tab)

Arguments

tab

An object of class tab.paired.

Details

The test is performed as described by McNemar (1947).

Value

A list containing:

sensitivity

A list containing test1 (sensitivity of test 1), test2 (specificity of test 2), diff (the difference in sensitivity, computed as test2 - test1), the test.statistic and the corresponding p.value.

specificity

A list containing test1 (specificity of test 1), test2 (specificity of test 2), diff (the difference in specificity, computed as test2 - test1), the test.statistic and the corresponding p.value.

method

The name of the method used to compare sensitivity and specificity, here “mcnemar”.

References

McNemar, Q. (1947). Note on the sampling error of the difference between correlated proportions or percentages. Psychometrika, 12(2):153-7.

See also

Examples

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.layout <- tab.paired(d=d, y1=y1, y2=y2, data=Paired1)
paired.layout 
#> 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
#> 
mcnem.results <- sesp.mcnemar(paired.layout)
str(mcnem.results)
#> List of 3
#>  $ sensitivity: Named num [1:5] 8.80e-01 7.56e-01 -1.24e-01 3.14e+01 2.14e-08
#>   ..- attr(*, "names")= chr [1:5] "test1" "test2" "diff" "test.statistic" ...
#>  $ specificity: Named num [1:5] 6.78e-01 7.97e-01 1.19e-01 1.28e+01 3.44e-04
#>   ..- attr(*, "names")= chr [1:5] "test1" "test2" "diff" "test.statistic" ...
#>  $ method     : chr "mcnemar"
mcnem.results
#> $sensitivity
#>          test1          test2           diff test.statistic        p.value 
#>   8.802661e-01   7.560976e-01  -1.241685e-01   3.136000e+01   2.143518e-08 
#> 
#> $specificity
#>          test1          test2           diff test.statistic        p.value 
#>   6.781609e-01   7.969349e-01   1.187739e-01   1.281333e+01   3.441579e-04 
#> 
#> $method
#> [1] "mcnemar"
#> 
mcnem.results$sensitivity["p.value"]
#>      p.value 
#> 2.143518e-08