mspline_basis {survextrap} | R Documentation |
Evaluate an M-spline basis matrix at the specified times.
Description
Evaluate an M-spline basis matrix at the specified times. Extrapolation beyond the boundary knots is done by assuming that each basis term is constant beyond the boundary.
Usage
mspline_basis(times, knots, degree = 3, integrate = FALSE, bsmooth = TRUE)
Arguments
times |
A numeric vector of times at which to evaluate the basis. |
knots |
Spline knots |
degree |
Spline degree |
integrate |
If |
bsmooth |
If |
Details
The lower boundary is fixed to zero, and each basis term is assumed to be zero at times less than zero, since these models are used for hazard functions in survival data.
Value
A two-dimensional array. Rows are the times, and columns are the basis terms.
References
The splines2 package is used.