Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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
)

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.

Value

No return value.

Author(s)

Göran Broström

See Also

Examples

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)

eha

Event History Analysis

v2.10.0
GPL (>= 2)
Authors
Göran Broström [aut, cre], Jianming Jin [ctb]
Initial release
2022-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.