Learn R Programming

tteICE (version 1.1.2)

plot_inc: Plot estimated cumulative incidence functions (CIFs)

Description

This function plots the estimated potential cumulative incidence function, along with pointwise confidence intervals.

Usage

plot_inc(
  fit,
  decrease = FALSE,
  conf.int = 0.95,
  xlab = "Time",
  xlim = NULL,
  ylim = c(0, 1),
  plot.configs = list(ylab = NULL, main = NULL, lty = 1, lwd = 2, ci.lty = 5, ci.lwd =
    1.5, legend = c("Treated", "Control"), col = c("brown", "darkcyan"), legend.cex =
    0.9, show.p.value = TRUE),
  ...
)

Value

Plot the cumulative incidence function results from a tteICE object

Arguments

fit

A fitted object returned by the function tteICE, surv.tteICE, or scr.tteICE.

decrease

A logical variable indicating the type of curve to display. If decrease = FALSE (default), cumulative incidence functions (CIFs) are plotted. If decrease = TRUE, survival functions are plotted instead.

conf.int

Confidence level for the pointwise confidence intervals If conf.int = NULL, no confidence intervals are provided.

xlab

Label for the x-axis.

xlim

A numeric vector of length 2 specifying the limits of the x-axis. If xlim = NULL (default), the limits are determined automatically from the data.

ylim

A numeric vector of length 2 specifying the limits of the y-axis. Defaults to ylim = c(0, 1).

plot.configs

A named list of additional plot configurations. Common entries include:

  • ylab: character, label for the y-axis (default: ylab=NULL, use the default label).

  • main: character, title for the plot (default: main=NULL, use the default label).

  • lty: line type for the curve (default: lty=1).

  • lwd: line width for the curve (default: lwd=2).

  • ci.lty: line type for confidence interval curves (default: ci.lty=5, ci.lwd=1.5).

  • ci.lwd: line width for confidence interval curves (default: ci.lwd=1.5).

  • legend: legend for the two group (default: legend=c('Treated','Control')).

  • col: color of the curve for the two group (default: col=c('brown','darkcyan')).

  • legend.cex: font size for the legend (default: legend.cex=0.9).

  • show.p.value: whether to show the p-value between two groups (default: show.p.value=TRUE, show the p-value)

...

Additional graphical arguments passed to function plot.default or function curve

See Also

plot.default, points, curve, plot.tteICE