Learn R Programming

ModelGood (version 1.0.9)

Sensitivity: Compute sensitivity, specificity and predictive values

Description

Compute sensitivity, specificity and predictive values

Usage

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

Value

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

Details

Confidence intervals are obtained with binom.test

See Also

binom.test

Examples

Run this code
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)

Run the code above in your browser using DataLab