AUCtest: AUC-Test

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Performs tests for one and two AUCs.

Usage

1
AUC.test(pred1, lab1, pred2, lab2, conf.level = 0.95, paired = FALSE)

Arguments

pred1

numeric vector.

lab1

grouping vector or factor for pred1.

pred2

numeric vector.

lab2

grouping vector or factor for pred2.

conf.level

confidence level of the interval.

paired

not yet implemented.

Details

If pred2 and lab2 are missing, the AUC for pred1 and lab1 is tested using the Wilcoxon signed rank test; see wilcox.test.

If pred1 and lab1 as well as pred2 and lab2 are specified, the Hanley and McNeil test (cf. Hanley and McNeil (1982)) is computed.

Value

A list with AUC, SE and confidence interval as well as the corresponding test result.

Author(s)

Matthias Kohl [email protected]

References

J. A. Hanley and B. J. McNeil (1982). The meaning and use of the area under a receiver operating characteristic (ROC) curve. Radiology, 143, 29-36.

See Also

wilcox.test, AUC

Examples

1
2
3
4
5
6
7
set.seed(13)
x <- rnorm(100) ## assumed as log2-data
g <- sample(1:2, 100, replace = TRUE)
AUC.test(x, g)
y <- rnorm(100) ## assumed as log2-data
h <- sample(1:2, 100, replace = TRUE)
AUC.test(x, g, y, h)

Example output

$Variable1
       AUC         SE     low CI      up CI 
0.55151515 0.05813581 0.43757105 0.66545925 

$Test

	Wilcoxon rank sum test with continuity correction

data:  0 and 1
W = 1110, p-value = 0.3789
alternative hypothesis: true AUC is not equal to 0.5


Warning message:
In AUC(pred1, group = lab1) :
  The computed AUC value 0.4484848 will be replaced by 0.5515152 which can be achieved be interchanging the sample labels!
$Variable1
       AUC         SE     low CI      up CI 
0.55151515 0.05813581 0.43757105 0.66545925 

$Variable2
       AUC         SE     low CI      up CI 
0.51660664 0.05798295 0.40296214 0.63025114 

$Test

	Hanley and McNeil test for two AUCs

data:  x and y
z = 0.42515, p-value = 0.6707
alternative hypothesis: true difference in AUC is not equal to 0
95 percent confidence interval:
 -0.1260211  0.1958381
sample estimates:
Difference in AUC 
       0.03490851 


Warning messages:
1: In AUC(pred1, group = lab1) :
  The computed AUC value 0.4484848 will be replaced by 0.5515152 which can be achieved be interchanging the sample labels!
2: In AUC(pred2, group = lab2) :
  The computed AUC value 0.4833934 will be replaced by 0.5166066 which can be achieved be interchanging the sample labels!

MKmisc documentation built on March 18, 2018, 1:43 p.m.