forest_plot.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 a ggplot2 object containing a forest plot of the risk differences. This function is also dispatched by calls to the generic forest_plot function when passed a cumrisk object.

# S3 method for cumrisk
forest_plot(
  ...,
  risk_time = NULL,
  effect_measure_type = NULL,
  alpha = 0.05,
  legend_title = "Treatment \nGroups",
  colors = "Dark2",
  ref = 1,
  boot_method = "normal"
)

Arguments

...

cumrisk objects supplied as a list or as seperate arguments

risk_time

The desired time at which to extract the the cumulative risk and risk difference. If null, uses the maximum time in the ipwrisk object.

effect_measure_type

The type of effect to plot (default NULL = plots cumulative risk funtions)

alpha

The desired nominal significance level of the confidence intervals.

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.

boot_method

The specific bootstrap approach used to compute confidence intervals (default method = "normal" for a normal approximation on the risk scale, other choices include "log normal" for normal approximation on the log scale).

Value

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

Author

M. Alan Brookhart