roc.eda: Exploratory data analysis for a three-class ROC marker

View source: R/roc.eda.R

roc.edaR Documentation

Exploratory data analysis for a three-class ROC marker

Description

A function that investigates data that arose from a single marker and containes the reference standard of the three classes "healthy", "intermediate" and "diseased".

Usage

roc.eda(
  x,
  y,
  z,
  dat = NULL,
  type = c("empirical", "trinormal"),
  plotVUS = FALSE,
  saveVUS = FALSE,
  sep.dens = FALSE,
  scatter = FALSE,
  conf.level = 0.95,
  n.boot = 1000,
  verbose = TRUE,
  alternative = c("two.sided", "less", "greater")
)

Arguments

x, y, z

numeric vectors contaning the measurements from the healthy, intermediate and diseased class.

dat

a data frame of the following structure: The first column represents a factor with three levels, containing the true class membership of each measurement. The levels are ordered according to the convention of higher values for more severe disease status.

type

a character, specifying if the empirical VUS and tests or the trinormal VUS and tests are computed.

plotVUS

a logical whether to evaluate and plot the VUS (default is FALSE). Note: To save a png plotVUS needs to be TRUE too.

saveVUS

a logical whether to save a PNG of the VUS in your current working directory (default is FALSE).

sep.dens

a logical indicating if the densitie plots should be plotted on separate x-axes (TRUE) or on a common axe (FALSE, is default).

scatter

a logical indicating if the measurements per class plot should be plotted as a boxplot (default) or as a scatterplot (scatter = TRUE).

conf.level

A numeric value between 0 and 1 yielding the significance level α=1-\code{conf.level}.

n.boot

an integer incicating the number of bootstrap replicates sampled to obtain the variance of the VUS. Default is 1000.

verbose

a logical, indicating whether output should be displayed or not. Default is TRUE.

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less".

Details

For the preliminary assessment of a classifier, exporatory data analysis (EDA) on the markers is necessary. This function assesses measurements from a single marker and computes the VUS, statistical tests and returns a summary table as well as some plots of the data.

Value

A list with class "htest" containing the following components:

statistic

The value of the test(s).

p.value

The p-value for the test(s).

VUS

the VUS computed with the specific method defined in type.

dat.summary

A data frame displaying size, mean and standard deviation of the three classes.

alternative

The alternative hypothesis.

type

a character containing the the method used for the exploratory data analysis.

data.name

a character containing the name of the data.

xVUS, yVUS, zVUS

(if plotVUS = TRUE) numeric vectors and matrices computed by rocsurf.emp or rocsurf.trin, used for displaying the surface with package rgl.

histROC

a ggplot2 object, displaying the historgrams and densities of the three classes.

meas.overview

A ggplot2 object, displaying the boxplots (if scatter = FALSE) or scatter plots of the three classes (if scatter = TRUE).

Warning

If type = "empirical", computation may take a while, as roc.eda calls the function boot.test().

See Also

trinROC.test, trinVUS.test for trinormal data investigation, boot.test for empirical data analysis. rocsurf.emp, rocsurf.trin for the surface plot.

Examples

data(krebs)

# empirical EDA:
roc.eda(dat = krebs[,c(1,5)], type = "e", plotVUS = FALSE)

# equal data input via:
x <- with(krebs, krebs[trueClass=="healthy", 5])
y <- with(krebs, krebs[trueClass=="intermediate", 5])
z <- with(krebs, krebs[trueClass=="diseased", 5])
roc.eda(x, y, z, type = "e", sep.dens = TRUE)

data(cancer)
# trinormal EDA:
roc.eda(dat = cancer[,c(1,10)], type = "trin", plotVUS = FALSE)
# trinormal EDA with different plots:
roc.eda(dat = cancer[,c(1,5)], type = "t", sep.dens = TRUE, scatter = TRUE)

trinROC documentation built on Oct. 29, 2022, 1:12 a.m.