roc {sdm} | R Documentation |
plot ROC curves
Description
Plot the Receiver Operating Characteristics (ROC) curve with AUC statistic in the legend.
Usage
roc(x,p=NULL,species=NULL,method=NULL,replication=NULL,run=NULL,
wtest=NULL,smooth=FALSE,legend=TRUE,...)
getRoc(x,p,...)
Arguments
x |
Either |
p |
if x is sdmModels, p is an optional vector with model ID number(s) that should be plotted (NULL (default means all models)); if x is a numeric vector, p is a vector with the same length including the predicted values |
species |
the name of species should be specified (required if x is |
method |
a character vector with the name of modelling methods that one need to get the roc plot for (if NULL [default], all methods in the object are considered); only if x is |
replication |
a character vector with the name of replication methods (i.e., 'sub','cv','boot') that one need to get the roc plot for |
run |
if x is |
wtest |
evaluation for which test datasets are required, maximum 2 names from 'training', 'test.dep', 'test.indep' (i.e., evaluation for training data, dependent test dataset, and independent test dataset, respectively) |
smooth |
logical, specified whether the ROC curves should be smoothed through a spline procedure |
legend |
logical, specified whether a legend including AUC statistic is required on the plot |
... |
additional arguments passed to plot function |
Details
roc generates the plots of roc curves, and getRoc generate the values of ROC
Value
an object of class matrix
Author(s)
Babak Naimi naimi.b@gmail.com
https://www.biogeoinformatics.org/
References
Naimi, B., Araujo, M.B. (2016) sdm: a reproducible and extensible R platform for species distribution modelling, Ecography, 39:368-375, DOI: 10.1111/ecog.01881
Examples
## Not run:
file <- system.file("external/model.sdm", package="sdm")
m <- read.sdm(file) # a sdmModels Object (fitted using sdm function)
roc(m)
roc(m,1) # for the first model
roc(m, 1:2)
roc(m,method = 'glm',smooth = T) # only for models fitted using glm method & with smoothed curve
## End(Not run)