Last data update: 2014.03.03

R: Weighted Generalized Score Statistic for Comparison of...
pv.wgsR Documentation

Weighted Generalized Score Statistic for Comparison of Predictive Values

Description

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

pv.gs and pv.rpv.

Examples

data(Paired1) # Hypothetical study data
ftable(Paired1)
paired.layout <- tab.paired(d=d, y1=y1, y2=y2, data=Paired1)
paired.layout 
wgs.results <- pv.wgs(paired.layout)
str(wgs.results)
wgs.results
wgs.results$ppv["p.value"]

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DTComPair)
Loading required package: gee
Loading required package: PropCIs
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DTComPair/pv.wgs.Rd_%03d_medium.png", width=480, height=480)
> ### Name: pv.wgs
> ### Title: Weighted Generalized Score Statistic for Comparison of
> ###   Predictive Values
> ### Aliases: pv.wgs
> 
> ### ** 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   :List of 5
  ..$ test1         : num 0.825
  ..$ test2         : num 0.865
  ..$ diff          : num 0.0401
  ..$ test.statistic: num 5.47
  ..$ p.value       : num 0.0194
 $ npv   :List of 5
  ..$ test1         : num 0.766
  ..$ test2         : num 0.654
  ..$ diff          : num 0.112
  ..$ test.statistic: num 16.5
  ..$ p.value       : num 4.78e-05
 $ method: chr "weighted generalized score statistic (wgs)"
> wgs.results
$ppv
$ppv$test1
[1] 0.8253638

$ppv$test2
[1] 0.8654822

$ppv$diff
[1] 0.04011841

$ppv$test.statistic
[1] 5.465887

$ppv$p.value
[1] 0.0193912


$npv
$npv$test1
[1] 0.7662338

$npv$test2
[1] 0.6540881

$npv$diff
[1] 0.1121457

$npv$test.statistic
[1] 16.5354

$npv$p.value
[1] 4.775012e-05


$method
[1] "weighted generalized score statistic (wgs)"

> wgs.results$ppv["p.value"]
$p.value
[1] 0.0193912

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>