roc_manyroc: Carry out the manyROC analysis

Description Usage Arguments Details Value Author(s) Examples

View source: R/roc_manyroc.R

Description

Do the ROC analysis (roc_analysis) for each column of x.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## S3 method for class 'manyroc_result'
print(x, ..., show_all = FALSE, perf_digits = 2, fmt = "%.3g")

roc_manyroc(x, gr = NULL, optimize_by = "bac", ...)

## S3 method for class 'matrix'
roc_manyroc(x, gr = NULL, optimize_by = "bac", ..., gr_sep = " vs. ")

## S3 method for class 'numeric'
roc_manyroc(x, gr = NULL, optimize_by = "bac", ...)

## S3 method for class 'data.frame'
roc_manyroc(x, gr = NULL, optimize_by = "bac", ...)

## S3 method for class 'hyperSpec'
roc_manyroc(x, gr = NULL, optimize_by = "bac", ...)

Arguments

x

A numeric matrix, a data frame, a hyperSpec object or another type of object, convertible to a numeric matrix.

...

Arguments passed for further methods.

show_all

(logical(1))
A flag if whole dataset should be printed. If FALSE, only a few fisrt and last rows will be printed.

perf_digits

(integer(1))
A number of decimals to display for performance measures. Default is 2.

fmt

(character(1))
A string indicating number display format for other numeric columns excluding performance measures. The string will be passed to sprintf. Default is "%.3g".

gr

Either a string (scalar, character(1)) or a factor variable (a vector) which defines groups in x.

optimize_by

(string(1))
A string with the name of classification performance measure to use. Currently available options:

  • "bac" - for balanced accuracy (mean of sensitivity and specificity);

  • "kappa" - for Cohens kappa;

  • "youden" - for Youden's index;

gr_sep

Group separator used to paste the names of groups. Default is " vs. ".

Details

  1. Consider ordering of factor gr levels before the analysis, as the first level will always be treated as negative and the last as positive. E.g., if we have factor with 3 levels in this particular order "A", "B", "C", then "A" will always be negative, "C" always positive and "B" positive, when compared to "A" and negative, when compared to "C". The same principle applies if there are more than 3 levels.
    This is important determining what specificity and sensitivity, etc., means in the context of group names: if positive is "A" then sensitivity will be related to group "A", but if "A" is negative, then specificity will be related to this group, and sensitivity to the other group.

  2. For spectroscopic data: compare spectra of each pair of indicated groups at each wavelength.

Value

Object of classes manyroc_result and data.frame with columns:

Author(s)

Vilmantas Gegzna

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library(manyROC)


# --- For numeric vectors objects ---

data(PlantGrowth)
roc_manyroc(x = PlantGrowth$weight, gr = PlantGrowth$group)


# --- For dataframes objects ---

data(CO2)
roc_manyroc(CO2[, c("conc", "uptake")], CO2$Type)

data(OrchardSprays)
roc_manyroc(OrchardSprays$decrease, OrchardSprays$treatment)

# --- For hyperSpec objects ---

library(hyperSpec)
fluorescence

roc_manyroc(fluorescence[, , 500 ~ 502], fluorescence$gr)

GegznaV/multiROC documentation built on Sept. 15, 2020, 10:33 a.m.