Skip to contents

Performs a test for differences in (positive and negative) predictive values of two binary diagnostic tests using a weighted generalized score statistic proposed by Kosinski (2013).

Usage

pv.wgs(tab)

Arguments

tab

An object of class tab.paired.

Value

A list containing:

ppv

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

npv

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

method

The name of the method used to compare predictive values, here “weighted generalized score statistic (wgs)”.

References

Kosinski, A.S. (2013). A weighted generalized score statistic for comparison of predictive values of diagnostic tests. Stat Med, 32(6):964-77.

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
#> 
wgs.results <- pv.wgs(paired.layout)
str(wgs.results)
#> List of 3
#>  $ ppv   : Named num [1:5] 0.8254 0.8655 0.0401 5.4659 0.0194
#>   ..- attr(*, "names")= chr [1:5] "test1" "test2" "diff" "test.statistic" ...
#>  $ npv   : Named num [1:5] 7.66e-01 6.54e-01 -1.12e-01 1.65e+01 4.78e-05
#>   ..- attr(*, "names")= chr [1:5] "test1" "test2" "diff" "test.statistic" ...
#>  $ method: chr "weighted generalized score statistic (wgs)"
wgs.results
#> $ppv
#>          test1          test2           diff test.statistic        p.value 
#>     0.82536383     0.86548223     0.04011841     5.46588745     0.01939120 
#> 
#> $npv
#>          test1          test2           diff test.statistic        p.value 
#>   7.662338e-01   6.540881e-01  -1.121457e-01   1.653540e+01   4.775012e-05 
#> 
#> $method
#> [1] "weighted generalized score statistic (wgs)"
#> 
wgs.results$ppv["p.value"]
#>   p.value 
#> 0.0193912