pre_data: Preparing monotone ordered disease classes

View source: R/preDisease.R

pre_dataR Documentation

Preparing monotone ordered disease classes

Description

pre_data is used to check and make a suitable monotone increasing ordering of the disease classes. In addition, this function also creates a binary matrix format of disease status to pass into the functions of bcROCsurface package.

Usage

pre_data(dise, diag_test, plot = TRUE)

Arguments

dise

a numeric vector/factor containing the disease status.

diag_test

a numeric vector containing the diagnostic test values. NA values are not admitted.

plot

if TRUE (the default) then a boxplot of diagnostic test based on three ordered groups is produced.

Details

The ROC surface analysis implemented in the package is coherent when the ordering of the diagnostic classes is monotone increasing. That is, for a diagnostic test T and three disease classes, 1, 2 and 3, the monotone increasing ordering of interest is T_1 < T_2 < T_3. Here, T_1, T_2 and T_3 are the measurements of diagnostic test T corresponding to class 1, 2 and 3, respectively. Note that, if an umbrella or tree ordering is of interest, then the results of ROC surface analysis is not reliable.

In order to find out the monotone ordering, we compute the medians of T_1, T_2 and T_3, and then sort the three medians in ascending order. After that, the three disease classes are reordered corresponding to the order of medians.

To be used in the functions of package bcROCsurface, the vector of disease status must be presented as a n * 3 binary matrix with the three columns, corresponding to the three classes.

With real data, the application of this function is the first step in the use of ROC analysis. Note that, if the user is sure that the disease classes follow a monotone increasing ordering and the disease matrix is available, then the use of pre_data is not necessary.

Value

This function returns a list containting a factor dise of ordered disease status and a binary matrix dise_vec of the disease status and a vector order containing the sequence of class labels.

Examples

data(EOC)
dise_full <- pre_data(EOC$D.full, EOC$CA125)



bcROCsurface documentation built on Sept. 9, 2023, 9:07 a.m.