gROC: ROC curve estimation (generalization included) In nsROC: Non-Standard ROC Curve Analysis

Description

This function estimates the Receiver Operating Characteristic curve and returns a 'groc' object. This object can be printed or plotted. It is the main function of the package and it includes the ROC curve generalization for non-monotone relationships (see References below).

Usage

 1 2 3 4 5 gROC(X, D, ...) ## Default S3 method: gROC(X, D, side=c("right", "left", "both", "both2", "auto"), Ni = NULL, plot.roc = FALSE, plot.density = FALSE, pval.auc = FALSE, B = 500, ...) 

Arguments

 X  vector of (bio)marker values. D  vector of response values. side  type of ROC curve. One of "right", "left", "both", "both2" or "auto". If the user does not specify the method, "right" is considered, i.e., the right-sided ROC curve is estimated. If "auto", one of "right" or "left" is assigned automatically according to the Wilcoxon statistic. If the estimate is lower than \frac{number \; of \; controls \times number \; of \; cases}{2}, the right-sided ROC curve is computed, otherwise the left one is considered. If "both", the gROC curve is estimated in the usual way (controls inside the interval) and if "both2", the opposite direction is considered. Ni  number of subintervals of the unit interval (FPR values) considered to calculate the curve. Default: NULL (in this case the fast algorithm considering as many FPR values as number of controls is considered). plot.roc  if TRUE, ROC curve estimate considered is displayed. plot.density  if TRUE, density estimates for the (bio)marker in the positive and negative subjects are displayed in the same plot. pval.auc  if TRUE, a permutation test to test if the AUC differs from $0.5$ is performed. Available if Ni is NULL. Default: FALSE. B  number of permutations used for testing. Default: 500. ...  additional arguments for gROC. Ignored.

Details

First of all, the data introduced is checked by the ROCcheck function.

If side is not specified, one of "right" or "left" options is considered according to the comparison of the Wilcoxon test estimate and \frac{number \; of \; controls \times number \; of \; cases}{2}. In this case, Wilcoxon rank test is performed in order to test the alternative hypothesis median(controls)<median(cases) and the resulting p-value is shown but side selection is just based in the aforementioned comparison, without taking into account the p-value of the test.

If Ni is NULL, the general ROC curve, R_g(.) is estimated considering every different pair (t, γ \cdot t) available on data. Otherwise it is estimated using {0, 1e-3, 2e-3, ..., 1} as a grid for γ in the unit interval.

If both plot.density and plot.roc are TRUE they are displayed in the same window.

Value

A list of class "groc" with the following content:

 levels  levels in D. The two first ones are the labels of D considered controls and cases, respectively. controls  marker values for controls. cases  marker values for cases. side  direction of the comparison between controls and cases. One of "right", "left", "both" or "both2". If side is auto in input arguments, the output will be the one considered by the function (according to the comparison specified above). pvalue.wilcox  p-value of Wilcoxon test performed to compare cases and controls. Alternative hypothesis: median(controls)

References

Martinez-Camblor P., Corral N., Rey C., Pascual J., Cernuda-Morollon E., 2014, ROC curve generalization for non-monotone relationships, Statistical Methods in Medical Research, 26(1), 113-123.

Examples

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 # Basic example (side="auto") -> Output side is "right" set.seed(123) X <- c(rnorm(45), rnorm(30,2,1.5)) D <- c(rep(0,45), rep(1,30)) gROC(X,D) # Basic example (side="auto") -> Output side is "left" X <- c(rnorm(45), rnorm(30,-2,1.5)) D <- c(rep(0,45), rep(1,30)) gROC(X,D) # General ROC curve example X <- c(rnorm(45), rnorm(30,1,4)) D <- c(rep(0,45), rep(1,30)) gROC(X, D, side="both") # Plot density estimates and ROC curve in the same plot X <- c(rnorm(45), rnorm(30,2,1.5)) D <- c(rep(0,45), rep(1,30)) gROC(X, D, plot.roc=TRUE, plot.density=TRUE) 

Example output

Data was encoded with 0 (controls) and 1 (cases).
Wilcoxon rank sum test:
alternative hypothesis: median(controls) < median(cases); p-value = 1.482e-09
It is assumed that larger values of the marker indicate larger confidence that a given subject is a case.
There are 45 controls and 30 cases.
The area under the ROC curve (AUC) is 0.877.
Data was encoded with 0 (controls) and 1 (cases).
Wilcoxon rank sum test:
alternative hypothesis: median(cases) < median(controls); p-value = 1
It is assumed that lower values of the marker indicate larger confidence that a given subject is a case.
There are 45 controls and 30 cases.
The area under the ROC curve (AUC) is 0.867.
Data was encoded with 0 (controls) and 1 (cases).
It is assumed that both lower and larges values of the marker indicate larger confidence that a given subject is a case.
There are 45 controls and 30 cases.
There are pairs of points returning the same sensitivity and specificity (See pairpoints.coordinates)
The area under the ROC curve (AUC) is 0.923.
Data was encoded with 0 (controls) and 1 (cases).
Wilcoxon rank sum test:
alternative hypothesis: median(controls) < median(cases); p-value = 8.965e-13
It is assumed that larger values of the marker indicate larger confidence that a given subject is a case.
There are 45 controls and 30 cases.
The area under the ROC curve (AUC) is 0.93.


nsROC documentation built on May 2, 2019, 2:31 p.m.