Description Usage Arguments Value See Also Examples
A utility function for that returns a step function given cumulative increments over time.
1 | step2stepfun(step, time = "time", stratum = NULL)
|
step |
a matrix whose columns give the (possibly multivariate) step function values, corresponding time points and strata. |
time |
an integer or character value indicating the column index or name of
the time variable in the matrix |
stratum |
integer or character value for the column index or name of the
stratifying variable in the matrix |
A function that returns cumulative increments for given times. If stratified, a list of such functions given in the same order as the strata.
1 2 3 4 5 6 | fit <- coxdual(Surv(start, stop, status) ~ cluster(id)
+ trans(from, to) + z, data = dualrc, init.coxph = TRUE)
head(fit$coxph$basehaz)
Hazfun <- step2stepfun(fit$coxph$basehaz, stratum = 3)
Haz01 <- with(fit$coxph, split(basehaz[, 1:2], basehaz[, 3]))[[1]]
all(Hazfun[[1]](Haz01$time) == Haz01$hazard)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.