step2jump: Increments from a step function of time

Description Usage Arguments Value See Also Examples

View source: R/step2jump.R

Description

A utility function for coxdual that returns increments from values of a step function over time.

Usage

1
step2jump(step, time = "time", stratum = NULL)

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".

stratum

integer or character value for the column index or name of the stratifying variable in the matrix step. If stratum is NULL (default), step is presumed unstratified.

Value

A matrix of the same dimension as step.

See Also

jump2step

Examples

1
2
3
4
5
fit <- coxdual(Surv(start, stop, status) ~ cluster(id)
               + trans(from, to) + z, data = dualrc, init.coxph = TRUE)
haz <- step2jump(fit$coxph$basehaz, stratum = 3)
Haz <- jump2step(haz, stratum = 3)
all(Haz == fit$coxph$basehaz)

coxinterval documentation built on May 19, 2017, 10:56 p.m.

Search within the coxinterval package
Search all R packages, documentation and source code