Learn R Programming

eha (version 2.11.2)

compHaz: Graphical comparison of cumulative hazards

Description

Comparison of the estimated baseline cumulative hazards functions for two survival models.

Usage

compHaz(
  fit1,
  fit2,
  main = NULL,
  lty = 1:2,
  col = c("red", "blue"),
  printLegend = TRUE
)

Value

No return value.

Arguments

fit1

An object of type "coxreg", "phreg", or other output from from survival fitters.

fit2

An object of type "coxreg", "phreg", or other output from survival fitters.

main

Header for the plot. Default is NULL.

lty

line types.

col

Line colors. should be NULL (black lines) or of length 2.

printLegend

Should a legend be printed? Default is TRUE.

Author

Göran Broström

See Also

hazards, coxreg, and phreg.

Examples

Run this code

fit.cr <- coxreg(Surv(enter, exit, event) ~ sex, data = oldmort)
fit.w <- phreg(Surv(enter, exit, event) ~ sex, data = oldmort)
compHaz(fit.cr, fit.w)

Run the code above in your browser using DataLab