Simulates data from piecwise constant baseline hazard that can also be of Cox type. Censor data at highest value of the break points.
rchaz(
cumhazard,
rr,
n = NULL,
entry = NULL,
cum.hazard = TRUE,
cause = 1,
extend = FALSE
)
cumulative hazard, or piece-constant rates for periods defined by first column of input.
relative risk for simulations, alternatively when rr=1 specify n
number of simulation if rr not given
delayed entry time for simuations.
specifies wheter input is cumulative hazard or rates.
name of cause
to extend piecewise constant with constant rate. Default is average rate over time from cumulative (when TRUE), if numeric then uses given rate.
For a piecewise linear cumulative hazard the inverse is easy to compute with and delayed entry x we compute $$\Lambda^{-1}(\Lambda(x) + E/RR)$$, where RR are the relative risks and E is exponential with mean 1. This quantity has survival function $$P(T > t | T>x) = exp(-RR (\Lambda(t) - \Lambda(x)))$$.