Calculation of AUC in R

I am creating ecological niche models for a set of species, and I would like to use AUC as an indicator of the quality of the ecological niche. Stephen Phillips, who developed Maxent, provides the code in his Maxent tutorial for calculating AUC in R. However, I am reading documents that present partial AUCs as more reliable and conceptually sound indicators. I think I understand how to calculate partial AUC using ROCR R, but how to calculate AUC?

Here is a tutorial script from Phillips:

presence<-read.csv("bradypus_variegatus_samplePredictions.csv")
background<-read.csv("bradypus_variegatus_backgroundPredictions.csv")
pp<-presence$Logistic.prediction
testpp<-pp[presence$Test.or.train=="test"]
trainpp<-pp[presence$Test.or.train=="train"]
bb<-background$logistic

combined<-c(testpp,bb)
label<-c(rep(1,length(testpp)),rep(0,length(bb)))
pred<-prediction(combined,label)
perf<-performance(pred,"tpr","fpr")
plot(perf,colorize=TRUE)
performance(pred,"auc")@y.values[[1]] #RETURNS AUC

AUC<-function(p,ind){
    pres<-p[ind]
    combined<-c(pres,bb)
    label<-c(rep(1,length(pres)),rep(0,length(bb)))
    predic<-prediction(combined,label)
    return(performance(predic,'auc')@y.values[[1]])
}

b1<-boot(testpp,AUC,100) #RETURNS AUC WITH STANDARD ERROR
b1

Any advice or suggestions would be greatly appreciated! Thank.

+5
source share
2 answers

Without knowing the specifics of your data set and application,

  • AUC: . ( , , )
  • AUC: AUC . ( - )

Soo...

  • AUC: AUC .
+2

ROCR AUC fpr.stop=. , , .

+1

All Articles