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, for either the cumulative risk or count estimates or the effect measures, or for the hazard ratios. Options are "normal" (normal approximation on the original scale), "log-normal" (normal approximation on the log scale), "percentile" (percentile-based approach using quantiles of the bootstrap distribution), and "basic" (basic bootstrap using the reflection method). The default varies by method ("normal" for cumrisk and cumcount objects, "log-normal" for hr objects). When a given input results object was created without using bootstrap estimation then the value of boot_method is ignored. Note that when a given input results object was created using bootstrap estimation and boot_method is "log-normal", then only effect measures specified via effect_measure_type with support on the positive real line can be used.

Value

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

Author

M. Alan Brookhart