lin2const: Slopes from values of a piecewise linear function of time

Description Usage Arguments Details Value See Also Examples

Description

A utility function for coxdual that gives the slope corresponding to values from a piecewise linear function of time.

Usage

1
lin2const(lin, time = "time", stratum = NULL)

Arguments

lin

a matrix whose columns give the (possibly multivariate) piecewise linear function values, time points and strata.

time

an integer or character value indicating the column index or name of the time variable in the matrix lin. Defaults to "time".

stratum

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

Details

This is a utility function for coxdual.

Value

A matrix of the same dimension as lin.

See Also

const2lin

Examples

1
2
3
4
5
6
7
data(dualrc)
fit <- coxdual(Surv(start, stop, status) ~ cluster(id)
               + trans(from, to) + z, data = dualrc, init.coxph = TRUE)
fit$basehaz
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.