Learn R Programming

MRIaggr (version 1.1.5)

calcROCthreshold: ROC analysis

Description

Perform a ROC analysis on a continuous variable for identifying a binary outcome.

Usage

"calcROCthreshold"(object, param, mask, plot = "ROC_Youden", digit = 10, filename = paste(object@identifier, "calcROCthreshold", plot, sep = "_"), update.object = FALSE, overwrite = FALSE, ...)

Arguments

object
an object of class MRIaggr. REQUIRED.
param
the contrast parameter(s) that should be used to identify the observations inside the mask. character vector. REQUIRED.
mask
the binary contrast parameter that will be used as the outcome in the ROC analysis. character vector. REQUIRED.
plot
the type of the graphic to display? character or FALSE. See the details section.
digit
the number of digits used to round the data. positive integer. NULL indicates no rounding.
filename
the name of the file used to export the plot. character.
update.object
should the resulting threshold analysis be stored in object@ls_descStats ? logical.
overwrite
if a threshold analysis is already stored in object@ls_descStats, can it be overwritten ? logical.
...
additional arguments to be passed to optionsMRIaggr for specifying the graphical parameters.

Value

An data.frame containing for each mask the AUC and AUPRC value, the optimal threshold and the corresponding sensitivity and specificity for the Youden criteria and a utility function taking into account the prevalence.

Details

This function requires to have installed the ROCR package to work.

ARGUMENTS: Arguments ... must correspond to some of the following arguments : height, numeric2logical, path, res, unit, verbose, width, window.

Possible values for plot are:

  • "ROC_Youden" : display the ROC curve with the optimal threshold according to the Youden index.
  • "ROC_prev" : display the ROC curve with the optimal threshold according to the utility function.
  • "boxplot_Youden" : display a boxplot of the contrast parameter for each outcome with the optimal threshold according to the Youden index.
  • "boxplot_prev" : display a boxplot of the contrast parameter for each outcome with the optimal threshold according to the utility function.
  • FALSE : no graphic is displayed.

See Also

selectDescStats to select the mask caracteristics.

Examples

Run this code
## load a MRIaggr object
data("MRIaggr.Pat1_red", package = "MRIaggr")
  
## ROC analysis
res <- calcROCthreshold(MRIaggr.Pat1_red, param = c("DWI_t0","T2_FLAIR_t2"),
                        mask = c("MASK_DWI_t0","MASK_T2_FLAIR_t2"), numeric2logical = TRUE)
  
res <- calcROCthreshold(MRIaggr.Pat1_red, param = c("DWI_t0","T2_FLAIR_t2"),
                        mask = c("MASK_DWI_t0","MASK_T2_FLAIR_t2"), numeric2logical = TRUE,
                        plot = "boxplot_Youden",
						update.object = TRUE, overwrite = TRUE)
						
selectDescStats(MRIaggr.Pat1_red, "Mask_threshold")

Run the code above in your browser using DataLab