aucWeighted | R Documentation |
This function calculates the area under the receiver-operator characteristic curve (AUC) following Mason & Graham (2002). Each case (presence/non-presence) can be assigned a weight, if desired.
aucWeighted( pres, contrast, presWeight = rep(1, length(pres)), contrastWeight = rep(1, length(contrast)), na.rm = FALSE, bg = NULL, bgWeight = NULL, ... )
pres |
Vector of predictions for "positive" cases (e.g., predictions at presence sites). |
contrast |
Vector of predictions for "negative" cases (e.g., predictions at absence/background sites). |
presWeight |
Weights of positive cases. The default is to assign each positive case a weight of 1. |
contrastWeight |
Weights of contrast cases. The default is to assign each case a weight of 1. |
na.rm |
Logical. If |
bg |
Same as |
bgWeight |
Same as |
... |
Other arguments (unused). |
A Numeric value.
Mason, S.J. and N.E. Graham. 2002. Areas beneath the relative operating characteristics (ROC) and relative operating levels (ROL) curves: Statistical significance and interpretation. Quarterly Journal of the Royal Meteorological Society 128:2145-2166. doi: 10.1256/003590002320603584
evaluate
, aucMultiWeighted
pres <- seq(0.5, 1, by=0.1) contrast <- seq(0, 1, by=0.01) # unweighted aucWeighted(pres, contrast) # weighted (weight presences with low predictions more) presWeight <- c(1, 1, 1, 0.5, 0.5, 0.5) aucWeighted(pres, contrast, presWeight=presWeight) # weighted (weight presences with high predictions more) presWeight <- c(0.5, 0.5, 0.5, 1, 1, 1) aucWeighted(pres, contrast, presWeight=presWeight) # weight presences and absences contrastWeight <- sqrt(contrast) aucWeighted(pres, contrast, presWeight=presWeight, contrastWeight=contrastWeight)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.