auc {SDMTools} | R Documentation |
auc
estimates the AUC of the ROC using a
Mann-Whitney U statistic.
Note: this method
will exclude any missing data.
auc(obs, pred)
obs |
a vector of observed values which must be 0 for absences and 1 for occurrences |
pred |
a vector of the same length as |
Returns a single value represting the AUC value.
Jeremy VanDerWal jjvanderwal@gmail.com
Kappa
, omission
,
sensitivity
, specificity
,
prop.correct
, confusion.matrix
,
accuracy
#create some data obs = c(sample(c(0,1),20,replace=TRUE),NA) pred = runif(length(obs),0,1) #calculate AUC from the random data auc(obs,pred) #calculate an example 'perfect' AUC obs = obs[order(obs)] pred = pred[order(pred)] auc(obs,pred)