This function performs estimations of ROC curves (without censoring) according to quantitative marker and a binary outcome.
ROC(status, marker, cut.values)
A numeric vector with the indicators of the disease (e.g. 0=disease-free, 1=disease).
A numeric vector with the values of the quantitative marker.
The threshold values of the marker for which the coordinates of the ROC are computed.
This function computes a traditional ROC curve (without right-censoring). The false positive and negative rates are obtained by estimating the corresponding proportion
The function returns a list.
cut.values is the vector of the input threshold values.
FP represent the corresponding false and true positive rates.
AUC is the area under the curve.
Y. Foucher <[email protected]>
1 2 3 4 5 6 7 8
# import and attach the data example X <- c(1, 2, 3, 4, 5, 6, 7, 8) # The value of the marker Y <- c(0, 0, 0, 1, 0, 1, 1, 1) # The value of the binary outcome ROC.obj <- ROC(status=Y, marker=X, cut.values=sort(X)) plot(ROC.obj$FP, ROC.obj$TP, ylab="True Positive Rates", xlab="False Positive Rates", type="s", lwd=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.