Function for computing the basis matrix for restricted cubic splines
cb(x, knots, ortho = TRUE, R.inv = NULL, intercept = TRUE)
Values to evaluate the basis functions in.
Chosen knots for the spline.
Logical. If TRUE
(default) orthogonalization of the basis matrix is carried out.
Matrix or vector containing the values of the R matrix from the QR decomposition of the basis matrix.
This is used for making new predictions based on the initial orthogonalization.
Therefore the default is NULL
.
Logical. If FALSE
, the intercept of the restricted cubic spline is removed.
A matrix with containing the basis functions evaluated in x
.
Royston P. and Parmar M.K. (2002) Flexible parametric proportional-hazards and proportional-odds models for censored survival data, with application to prognostic modelling and estimation of treatment effects. Statistics in Medicine, 21:15.