step2stepfun: Step function from cumulative increments over time

Description Usage Arguments Value See Also Examples

Description

A utility function for that returns a step function given cumulative increments over time.

Usage

1
step2stepfun(step, time = "time", strata = "strata", ...)

Arguments

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 step. Defaults to "time".

strata

integer or character value for the column index or name of the stratifying variable in the matrix step. Defaults to "strata". If any character value provided is not a column name, step is presumed unstratified.

...

extra variables passed to stepfun.

Value

A function that returns cumulative increments for given times. If stratified, a list of such functions given in the same order as the strata.

See Also

jump2step, step2jump, stepfun

Examples

1
2
3
4
5
6
fit <- coxdual(Surv(start, stop, status) ~ cluster(id)
               + strata(from, to) + z, data = dualrc, init.coxph = TRUE)
head(fit$coxph$basehaz)
Hazfun <- step2stepfun(fit$coxph$basehaz)
Haz01 <- with(fit$coxph, split(basehaz[, 1:2], basehaz[, 3]))[[1]]
all(Hazfun[[1]](Haz01$time) == Haz01$hazard)

aboruvka/coxinterval documentation built on May 10, 2019, 4:14 a.m.