preDATA {bcROCsurface} | R Documentation |
preDATA
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.
preDATA(D, T, plot = TRUE)
D |
a numeric vector/factor containing the disease status. |
T |
a numeric vector containing the diagnostic test values. |
plot |
if TRUE (the default) then a boxplot of diagnostic test T based on three ordered groups is produced. |
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 preDATA
is not necessary.
This function returns a list containting a factor D
of ordered disease status and a binary matrix Dvec
of the disease status and a vector order
containing the sequence of class labels.
data(EOC) Dfull <- preDATA(EOC$D.full, EOC$CA125)