plotsROCt: Plots of time-dependent ROC curve estimations

Description Usage Arguments Details Examples

Description

Plots of both Cumulative and Incident/Dynamic ROC curve estimations, provided by function stRoc.

Usage

1
2
## S3 method for class 'sROCt'
plot(x, tcr, xlab, ylab, type = "l", lwd = 5, ...)

Arguments

x

object of class sROCt generated with stRoc function and containing the estimations of the time-dependent ROC curves for one single point or a vector of points.

tcr

type of time-dependent ROC curve estimation that will be plotted:

  • “C” for Cumulative/Dynamic,

  • “I” for Incident/Dynamic,

  • “B” for Both time-dependent ROC curve estimations.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)

Example output

Loading required package: survival
========================================
                                        
================================================================================
================================================================================
Warning messages:
1: In regularize.values(x, y, ties, missing(ties), na.rm = na.rm) :
  collapsing to unique 'x' values
2: In regularize.values(x, y, ties, missing(ties), na.rm = na.rm) :
  collapsing to unique 'x' values

smoothROCtime documentation built on May 2, 2019, 9:16 a.m.