plot.sROCt {smoothROCtime} | R Documentation |
Plots of time-dependent ROC curve estimations
Description
Plots of both Cumulative and Incident/Dynamic ROC curve estimations, provided by function stRoc
.
Usage
## S3 method for class 'sROCt'
plot(x, tcr, xlab, ylab, type = "l", lwd = 5, ...)
Arguments
x |
object of class sROCt generated with |
tcr |
type of time-dependent ROC curve estimation that will be plotted:
|
xlab |
a tittle for the x axis. The default value is "False - Positive Rate". |
ylab |
a tittle for the y axis. The default value is "True - Negative Rate". |
type |
what type of plot is going to be drawn. The default value is "l" and a line will be plotted. |
lwd |
line width. As a default value "5" is taken. |
... |
plot function arguments can also be used for customizing the plot. |
Details
Parameter tcr
is mandatory with no default values. If a "B" is indicated and the sROCt object placed as x
parameter contains only one type of time-dependent ROC curve estimation, an error message will be returned. Another error message will appear in case of placing either "C" or "I" when the sROCt object does not contain the suitable ROC curve estimation.
When one single type of ROC curve estimation is chosen, one graphic will be drawn for each point of time in the sROCt object, having as many independent plots as number of points of time. Graphic parameters like axis labels or line width will be the same for all the plots.
In case of choosing both time-dependent ROC curve estimations, they will be plotted in a single graphic for each point of time in sROCt object. As before, we will have as many independent plots as points of time and the graphic parameters will be the same in all plots.
Examples
library(smoothROCtime)
require(survival)
# Monoclonal Gammapothy of Undetermined Significance dataset
data(mgus)
# Time-to-event
time <- ifelse(is.na(mgus$pctime), mgus$futime,mgus$pctime)
# Status
status <- ifelse(is.na(mgus$pctime), 0, 1)
# Preparing data
DT <-as.data.frame(cbind(log(time), status, mgus$alb))
colnames(DT) <- c("futime", "pcm", "alb")
dta <- na.omit(cbind(DT$futime, DT$pcm, -DT$alb))
# Point of Time
t10 <- log(10*365.25) # ten years in logarithm scale
# Cumulative/Dynamic and Incident dynamic ROC curve estimations at t=10 years
rcu <- stRoc(data=dta, t=t10, tcr="B", meth = "1", verbose=TRUE)
# Plots of both ROC curve estimations
plot(rcu, tcr="B", frame=FALSE)