View source: R/mspline_basis.R
mspline_basis | R Documentation |
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.
mspline_basis(times, knots, degree = 3, integrate = FALSE, bsmooth = TRUE)
times |
A numeric vector of times at which to evaluate the basis. |
knots |
Spline knots |
degree |
Spline degree |
integrate |
If |
bsmooth |
If |
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.
A two-dimensional array. Rows are the times, and columns are the basis terms.
The splines2 package is used.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.