accuracy: Measures of Model Accuracy

Description Usage Arguments Value Author(s) See Also Examples

Description

accuracy estimates six measures of accuracy for presence-absence or presence-psuedoabsence data. These include AUC, ommission rates, sensitivity, specificity, proportion correctly identified and Kappa.

Note: this method will exclude any missing data.

Usage

1
accuracy(obs, pred, threshold = 0.5)

Arguments

obs

a vector of observed values which must be 0 for absences and 1 for occurrences

pred

a vector of the same length as obs representing the predicted values. Values must be between 0 & 1 prepresenting a likelihood.

threshold

this can be:
a) a single value representing a single threshold between 0 & 1;
b) a vector of threshold values between 0 & 1; OR
c) an integer value representing the number of equal interval threshold values between 0 & 1

Value

a data.frame with seven columns:

threshold

the threshold values representing each row of data

AUC

the AUC given the defined threshold value

ommission.rate

the ommission rate as a proportion of true occurrences misidentified given the defined threshold value

sensitivity

the sensitivity given the defined threshold value

specificity

the specificity given the defined threshold value

prop.correct

the proportion of the presence and absence records correctly identified given the defined threshold value

Kappa

the Kappa statistic of the model given the defined threshold value

Author(s)

Jeremy VanDerWal jjvanderwal@gmail.com

See Also

auc, Kappa, omission, sensitivity, specificity, prop.correct, confusion.matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#create some data
obs = c(sample(c(0,1),20,replace=TRUE),NA); obs = obs[order(obs)]
pred = runif(length(obs),0,1); pred = pred[order(pred)]

#calculate accuracy of the model with a single threshold value
accuracy(obs,pred,threshold=0.5)

#calculate accuracy given several defined thresholds
accuracy(obs,pred,threshold=c(0.33,0.5,0.66))

#calculate accuracy given a number of equal interval thresholds
accuracy(obs,pred,threshold=20)

jjvanderwal/SDMTools documentation built on May 19, 2019, 11:40 a.m.