get_H0: Interpolate cumulative hazard function from a fitted Cox...

View source: R/fic.coxph.R

get_H0R Documentation

Interpolate cumulative hazard function from a fitted Cox model

Description

Returns the baseline cumulative hazard, at the requested times, from a Cox model fitted by coxph. Linear interpolation is used, assuming the hazard is piecewise constant, thus the cumulative hazard is piecewise linear.

Usage

get_H0(H0, t)

Arguments

H0

output from basehaz, containing estimates of the baseline cumulative hazard at a series of times.

t

vector of times for which cumulative hazard estimates are required.

Details

This does not extrapolate. If t is outside the observed event times, then NA will be returned.

Value

Fitted cumulative hazard at t.

Examples


library(survival)
wide <- coxph(Surv(years, death==1) ~ sex + thick_centred +
              infilt + epith + ulcer + depth + age, data=melanoma)
basehaz(wide)
get_H0(basehaz(wide), c(0,1,5,10,100))



chjackson/fic documentation built on Aug. 30, 2023, 6:48 p.m.