plot_boot_cumrisk is a function that takes as an argument a list of cumrisk objects, or the objects provided as independent arguments, each representing a set of cumulative incidence functions. The function returns paneled ggplot2 object depicting each set of cumulative risk functions and their estimated 95% confidence intervals. This function is also dispatched by calls to the generic plot function when passed a cumrisk object.

plot_boot_cumrisk(
  ...,
  rd = FALSE,
  overlay = FALSE,
  smooth = FALSE,
  ncol = 2,
  panel_dim = 1,
  time_lab,
  alpha = 0.05,
  scales = "free_y",
  stepribbon = TRUE,
  legend_title = "Treatment \nGroups",
  colors = "Dark2",
  ref = 1
)

Arguments

...

cumrisk objects supplied as a list or as seperate arguments

rd

A flag to indicate whether the risk difference should be plotted or the individual risk functions.

overlay

A flag to indicate that the risk difference curves should be overlayed rather than paneled

smooth

A flag to indicate the use of LOESS smoothing for risk difference

ncol

The number of columns for the faceting.

panel_dim

The number of dimensions for the faceting (either 1 or 2). Panels are faceted using the first (and if panel_dim = 2) and second elements of the labels vector in the supplied objects.

time_lab

A numeric vector denoting the x-axis tick marks to be labeled. Default is the ggplot2 default. Setting the parameter to NULL suppressed labeling.

alpha

The desired nominal significance level of the confidence intervals.

scales

A ggplot2 option for facet_grid/facet_wrap that controls the scales on facted plots. It can be fixed ("fixed"), free ("free"), or free in one dimension ("free.x", "free.y"). The default is "free.y."

stepribbon

A flag to determine whether to force the confidence intervals to be plotted using the stepribbon geom. The default is TRUE.

legend_title

A string used to title the legend, default is "Treatment Groups"

colors

Set colors for resulting ggplot object. Either a vector of strings which are interpreted as RGB codes or a sinlge string that identifies a color brewer palette. If set to NULL, plot.cumrisk will use grey shades. As a default, plot.cumrisk uses the color brewer palette 'Dark2'.

ref

Identifies the treatmet group in the supplied object(s) to be used as a referent category for risk differecence curves. Defaults to one.

Value

A ggplot2 object that can be further modified by the user before plotting.

Author

M. Alan Brookhart