roc {analogue} | R Documentation |
Fits Receiver Operator Characteristic (ROC) curves to training set data. Used to determine the critical value of a dissimilarity coefficient that best descriminate between assemblage-types in palaeoecological data sets, whilst minimising the false positive error rate (FPF).
roc(object, groups, ...) ## S3 method for class 'mat': roc(object, groups, ...)
object |
an R object. |
groups |
numeric; a vector of group memberships, one entry per sample in the training set data. |
... |
arguments passed to/from other methods. |
A ROC curve is generated from the within-group and between-group dissimilarities.
Within-group dissimilarities are the cells in the lower-triangle dissimilarity matrix representing the pairwise dissimilarities for samples amples in the same group, over all groups.
The between-group dissimilarities are the cells in the lower-triangle dissimilarity matrix between samples of in a group and all samples not in that group, over all groups.
A list, with the following components:
TPF |
The true positive fraction. |
FPE |
The false positive error |
roc.points |
The unique dissimilarities at which the ROC curve was evaluated |
roc.values |
The difference between TPF and FPE at each evaluated point of the ROC curve. |
optimal |
The optimal dissimilarity value, asessed where
roc.values is maximal. |
wilcox |
an object of class "htest" , the result of a call
to wilcox.test . Contains the results of a Wilcoxon
Rank Sum and Signed Rank test applied to the within and between
group dissimilarities. |
AUC |
The area under the ROC curve. |
n.within |
numeric; the number of within group dissimilarities. |
n.without |
numeric; the number of outside of group dissimilarities. |
groups |
numeric; the group membership |
dissims |
numeric; vector of observed dissimilarities. |
method |
character; the dissimilarity coefficient used. Taken
from "object ". |
call |
the system call. |
Gavin L. Simpson, based on code from Thomas Lumley to optimise the calculation of the ROC curve.
Brown, C.D., and Davis, H.T. (2006) Receiver operating characteristics curves and related decision measures: A tutorial. Chemometrics and Intelligent Laboratory Systems 80, 24–38.
Gavin, D.G., Oswald, W.W., Wahl, E.R. and Williams, J.W. (2003) A statistical approach to evaluating distance metrics and analog assignments for pollen records. Quaternary Research 60, 356–367.
Henderson, A.R. (1993) Assessing test accuracy and its clinical consequences: a primer for receiver operating characteristic curve analysis. Annals of Clinical Biochemistry 30, 834–846.
mat
for fitting of MAT models.
bootstrap
and mcarlo
for alternative methods
for selecting critical values of analogue-ness for dissimilarity
coefficients.
## continue the example from join() example(join) ## fit the MAT model using the squared chord distance measure swap.mat <- mat(swapdiat, swappH, method = "SQchord") ## fit the ROC curve to the SWAP diatom data using the MAT results ## Generate a grouping for the SWAP lakes clust <- hclust(as.dist(swap.mat$Dij), method = "ward") grps <- cutree(clust, 12) ## fit the ROC curve swap.roc <- roc(swap.mat, groups = grps) swap.roc