roc: plot ROC curves

Description Usage Arguments Details Value Author(s) References Examples

Description

Plot the Receiver Operating Characteristics (ROC) curve with AUC statistic in the legend.

Usage

1
2
3
4
roc(x,p=NULL,species=NULL,method=NULL,replication=NULL,run=NULL,
     wtest=NULL,smooth=FALSE,legend=TRUE,...)
     
getRoc(x,p,...)

Arguments

x

Either sdmModels, or sdmEvaluate object; or a numeric vector including observed binary values of species occurrence

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 sdmModels containing models for several species)

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 sdmModels

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 sdmModels, and the models are fitted through a replication procedure, run specifies which runs of the partitioning (replications) are required; if NULL, all are considered

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.r-gis.net/

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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)

Example output

Loading required package: sp
sdm 1.0-67 (2019-02-26)
Loading required package: dismo
Loading required package: raster
Loading required package: gbm
Loaded gbm 2.1.5
Loading required package: tree
Loading required package: mda
Loading required package: class
Loaded mda 0.4-10

Loading required package: mgcv
Loading required package: nlme

Attaching package: 'nlme'

The following object is masked from 'package:raster':

    getData

This is mgcv 1.8-28. For overview type 'help("mgcv-package")'.
Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-16

Loading required package: earth
Loading required package: Formula
Loading required package: plotmo
Loading required package: plotrix
Loading required package: TeachingDemos
Loading required package: rJava
Loading required package: RSNNS
Loading required package: Rcpp
Loading required package: randomForest
randomForest 4.6-14
Type rfNews() to see new features/changes/bug fixes.
Loading required package: rpart
Loading required package: kernlab

Attaching package: 'kernlab'

The following objects are masked from 'package:raster':

    buffer, rotated

sdm documentation built on Nov. 12, 2021, 9:06 a.m.

Related to roc in sdm...