multiclass.roc {pROC} | R Documentation |
This function builds builds multiple ROC curve to compute the multi-class AUC as defined by Hand and Till.
multiclass.roc(...) ## S3 method for class 'formula' multiclass.roc(formula, data, ...) ## Default S3 method: multiclass.roc(response, predictor, levels=base::levels(as.factor(response)), percent=FALSE, ...)
response |
a factor, numeric or character vector of
responses, typically encoded with 0 (controls) and 1 (cases), as in
|
predictor |
a numeric vector, containing the value of each
observation, as in |
formula |
a formula of the type |
data |
a matrix or data.frame containing the variables in the
formula. See |
levels |
the value of the response for controls and cases
respectively. In contrast with |
percent |
if the sensitivities, specificities and AUC must be
given in percent ( |
... |
further arguments passed to |
This function performs multiclass AUC as defined by Hand and Till
(2001). A multiclass AUC is a mean of auc
and cannot be
plotted.
This function has been much less tested than the rest of the package and is more subject to bugs. Please report them if you find one. Confidence intervals and comparison tests are not implemented yet.
A list of class “multiclass.roc” with the following fields:
auc |
if called with |
ci |
if called with |
response |
the response vector as passed in argument. If
|
predictor |
the predictor vector as passed in argument. If
|
levels |
the levels of the response as defined in argument. |
percent |
if the sensitivities, specificities and AUC are reported in percent, as defined in argument. |
call |
how the function was called. See |
If response
is an ordered factor and one of the levels
specified in levels
is missing, a warning is issued and the
level is ignored.
David J. Hand and Robert J. Till (2001). A Simple Generalisation of the Area Under the ROC Curve for Multiple Class Classification Problems. Machine Learning 45(2), p. 171–186. DOI: 10.1023/A:1010920819831.
data(aSAH) # Basic example multiclass.roc(aSAH$gos6, aSAH$s100b) # Produces an innocuous warning because one level has no observation # Select only 3 of the aSAH$gos6 levels: multiclass.roc(aSAH$gos6, aSAH$s100b, levels=c(3, 4, 5)) # Give the result in percent multiclass.roc(aSAH$gos6, aSAH$s100b, percent=TRUE)