Sensitivity: Compute sensitivity, specificity and predictive values

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

View source: R/Sensitivity.R

Description

Compute sensitivity, specificity and predictive values

Usage

1
2
3
4
Sensitivity(x,event,cutoff,comparison=">=",...)
       Specificity(x,event,cutoff,comparison=">=",...)
       NPV(x,event,cutoff,comparison=">=",...)
       PPV(x,event,cutoff,comparison=">=",...)

Arguments

x

Either a binary 0,1 variable, or a numeric marker which is cut into binary.

event

Binary response variable. Either a 0,1 variable where 1 means 'event', or a factor where the second level means 'event'.

cutoff

When x is a numeric marker, it is compared to this cutoff to obtain a binary test.

comparison

How x is to be compared to the cutoff value

...

passed on to binom.test

Details

Confidence intervals are obtained with binom.test

Value

list with Sensitivity, Specificity, NPV, PPV and confidence interval

Author(s)

Thomas A. Gerds <[email protected]>

See Also

binom.test

Examples

1
2
3
4
5
6
7
8
9
set.seed(17)
x <- rnorm(10)
y <- rbinom(10,1,0.4)
Sensitivity(x,y,0.3)
Specificity(x,y,0.3)
PPV(x,y,0.3)
NPV(x,y,0.3)

Diagnose(x,y,0.3)

Example output

Sensitivity: 16.7 (CI_95:[0.4,64.1])
Specificity: 25 (CI_95:[0.6,80.6])
Positive predictive value: 25 (CI_95:[0.6,80.6])
Negative predictive value: 16.7 (CI_95:[0.4,64.1])
2x2 table:
    event
test 0 1
   0 1 5
   1 3 1

Diagnostic parameters:
     Parameter   Estimate CI.95     
[1,] Sensitivity 16.7     [0.4,64.1]
[2,] Specificity 25       [0.6,80.6]
[3,] PPV         25       [0.6,80.6]
[4,] NPV         16.7     [0.4,64.1]

ModelGood documentation built on May 29, 2017, 4:14 p.m.