const2lin: Accumulate values from a piecewise constant function of time

Description Usage Arguments Value See Also Examples

Description

A utility function for coxdual that integrates values from a piecewise constant function of time.

Usage

1
const2lin(const, time = "time", stratum = NULL)

Arguments

const

a matrix whose columns give the (possibly multivariate) piecewise constant 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 const. Defaults to "time".

stratum

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

Value

A matrix of the same dimension as const.

See Also

lin2const

Examples

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

coxinterval documentation built on May 2, 2019, 9:36 a.m.