findROC: Compute the area under the ROC curve

Description Usage Arguments Value See Also Examples

View source: R/add.r

Description

This function computes the numeric value of area under the ROC curve (AUC) with the trapezoidal rule. It is a wrapper function around the pRoc function in the roc package

Usage

1
findROC(Data, coeff)

Arguments

Data

a data matrix; in the first column there should be the binary response variable y. If you give the training dataset it will calculate the in-sample AUC. If supplied with a new dataset then it will return the predictive AUC.

coeff

vector of coefficients

Value

The area under the ROC curve, the sensitivity and specificity

See Also

roc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
set.seed(14)
beta    <- c(3, 2, -1.6, -4)
noise   <- 5
simData <- SimData(N=100,beta=beta, noise=noise, corr=FALSE)

stepPenal<- StepPenal(Data=simData, lamda=1.2, w=0.7)

(coeffP <- stepPenal$coeffP)

findROC(simData, coeff=coeffP)

## End(Not run)

Example output

     X4      X1      X2      X3 
-2.3569  1.3433  1.0387  0.0000 

Call:
roc.default(response = Data[, 1], predictor = c(Xbpenal))

Data: c(Xbpenal) in 40 controls (Data[, 1] 0) < 60 cases (Data[, 1] 1).
Area under the curve: 0.9571

stepPenal documentation built on May 1, 2019, 10:11 p.m.

Related to findROC in stepPenal...