Learn R Programming

icpack (version 0.1.0)

plot.icfit: Plot method for an object of class `icfit`

Description

Plot method for an object of class `icfit`

Usage

# S3 method for icfit
plot(
  x,
  type = c("hazard", "cumhazard", "survival", "probability"),
  conf.int = TRUE,
  ylim = NULL,
  title = NULL,
  xlab = NULL,
  ylab = NULL,
  fill = TRUE,
  fillcol = "lightgrey",
  ...
)

Value

A ggplot grob, containing the plot. Use print() or plot() to show it Multiple objects can be combined by using functions in the package gridExtra.

Arguments

x

The object of class 'icfit' to be plotted

type

Type of plot. Accepted choices: 'hazard' (default), 'cumhazard', 'survival' or 'cumprob'

conf.int

If `TRUE` a 100*(1 - alpha) percent confidence interval is plotted

ylim

The y-limits for the plot

title

Optional title string

xlab

Text for x-label

ylab

Text for y-label

fill

Fill area between lower and upper

fillcol

The color for filling (default 'lightgrey')

...

Other arguments to plot (except `type`, which is set to 'l')

Examples

Run this code
# \donttest{
icf <- icfit(Surv(left, right, type='interval2') ~ period + gender + age, 
             data = drugusers)
plot(icf)
# }

Run the code above in your browser using DataLab