plot.logrank {eha}R Documentation

Plots of hazdata objects.

Description

Baseline hazards estimates.

Usage

## S3 method for class 'logrank'
plot(
  x,
  fn = c("cum", "surv", "log", "loglog"),
  xlim = NULL,
  ylim = NULL,
  main = NULL,
  xlab = "",
  ylab = "",
  col = "black",
  lty = 1,
  printLegend = TRUE,
  ...
)

Arguments

x

A logrank object, typically the 'hazards' element in the output from link{logrank}.

fn

Which type of plot? Allowed values are "cum" (or "cumhaz"), "surv" (or "sur"), "log", or "loglog". The last two plots the cumulative hazards on a log (y) scale or a log-log (xy) scale, respectively.

xlim

Horizontal plot limits. If NULL, calculated by the function.

ylim

Vertical plot limits. If NULL, set to c(0, 1) for a plot of the survival function.

main

A heading for the plot.

xlab

Label on the x axis.

ylab

Label on the y-axis.

col

Color of the lines. May be a vector of length equal to No. of strata.

lty

Line type(s). May be a vector of length equal to No. of strata.

printLegend

Logical or character; should a legend be produced? Defaults to TRUE. If character, it should be one of bottomleft, bottomright, etc, see legend.

...

Anything that plot.default likes...

Details

It is also possible to have as first argument an object of type "coxreg", given that it contains a component of type "hazdata".

Value

A list where the elements are two-column matrices, one for each stratum in the model. The first column contains risktimes, and the second the y coordinates for the requested curve(s).

Note

x is a list where each element is a two-column matrix. The first column contains failure times, and the second column contains the corresponding 'hazard atoms'.

Author(s)

Göran Broström

Examples


fit <- logrank(Surv(enter, exit, event), group = civ, data = oldmort[oldmort$region == "town", ])
plot(fit)


[Package eha version 2.11.4 Index]