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", strata = "strata")

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

strata

integer or character value for the column index or name of the stratifying variable in the matrix const. Defaults to "strata". If any character value provided is not a column name, 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)
               + strata(from, to) + z, data = dualrc, init.coxph = TRUE)
haz <- lin2const(fit$basehaz)
Haz <- const2lin(haz)
all(Haz == fit$basehaz)

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