linapprox: Linear approximation

Description Usage Arguments Value See Also Examples

Description

Perform linear interpolation or extrapolation

Usage

1
linapprox(xyin, xout)

Arguments

xyin

a matrix whose rows give the coordinate pairs of the points to be interpolated or extrapolated.

xout

a vector of numeric values at which interpolation or extrapolation should take place.

Value

A vector of interpolated or extrapolated values.

See Also

approx const2lin lin2const

Examples

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

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