Learn R Programming

reportROC (version 3.6)

reportROC: An Easy Way to Report ROC Analysis

Description

Provides an easy way to report the results of ROC analysis, including: 1. an ROC curve. 2. the value of Cutoff, AUC (Area Under Curve), ACC (accuracy), SEN (sensitivity), SPE (specificity), PLR (positive likelihood ratio), NLR (negative likelihood ratio), PPV (positive predictive value), NPV (negative predictive value).

Usage

reportROC(gold,predictor,predictor.binary,important,positive,exact,plot,xlab,ylab)

Arguments

gold

numeric(0/1) or binary, the 'gold standard'; typically encoded with 0 (controls) and 1 (cases)

predictor

numeric, the predictor variable

predictor.binary

numeric(0/1) or binary, if this argument was used, other arguments including 'predictor' and 'important' would be disabled

important

'se' or 'sp', some Youden index maybe the same, and 'important' is to indicate which is more important between sensitivity and specificity

positive

logic, 'l': the larger predictor or predictor.binary indicates the 'cases', 's': the smaller one indicates the 'cases'

exact

logic, whether to calculate the exact p value for AUC

plot

logic, whether to plot the ROC curve with specific style

xlab

character, the name of X axis

ylab

character, the name of Y axis

Value

Curoff

cutoff, only for numeric predictor

AUC

Area Under Curve, AUC

AUC.SE

the standard error of AUC

AUC.low,AUC.up

the 95 percent CI of AUC

P

the p value for AUC using one-sided test, which is different from SPSS using two-sided test

ACC

accuracy

ACC.low,ACC.up

the 95 percent CT of accuracy

SEN,SEN.low,SEN.up

the esitmate and the 95 percent CI of sensitivity

SPE,SPE.low,SPE.up

the esitmate and the 95 percent CI of specificity

PLR,PLR.low,PLR.up

the esitmate and the 95 percent CI of positive likelihood ratio

NLR,NLR.low,NLR.up

the esitmate and the 95 percent CI of negative likelihood ratio

PPV,PPV.low,PPV.up

the esitmate and the 95 percent CI of positive predictive value

NPV,NPV.low,NPV.up

the esitmate and the 95 percent CI of negative predictive value

PPA,PPA.low,PPA.up

the esitmate and the 95 percent CI of percentage of positive accordance

NPA,NPA.low,NPA.up

the esitmate and the 95 percent CI of percentage of negative accordance

TPA,TPA.low,TPA.up

the esitmate and the 95 percent CI of percentage of total accordance

KAPPA,KAPPA.low,KAPPA.up

the esitmate and the 95 percent CI of Kappa

See Also

nothing

Examples

Run this code
# NOT RUN {
data(aSAH)
#for continuous variables
reportROC(gold=aSAH$outcome,predictor=aSAH$s100b,important="se",plot=TRUE)
#for binary variables
binary=rep(0,nrow(aSAH))
binary[aSAH$s100b>=0.205]=1
reportROC(gold=aSAH$outcome,predictor.binary=binary)
reportROC(gold=aSAH$outcome[1:50],predictor.binary=binary[1:50],exact=FALSE)
# }

Run the code above in your browser using DataLab