bspline {spBayesSurv} | R Documentation |
Generate a Cubic B-Spline Basis Matrix
Description
Generate the B-spline basis matrix for a cubic spline with the first and last columns dropped.
Usage
bspline(x, df=NULL, knots=NULL, Boundary.knots = range(x))
Arguments
x |
the predictor variable. Missing values are allowed. |
df |
degrees of freedom; one can specify |
knots |
the internal breakpoints that define the spline. The default is |
Boundary.knots |
boundary points at which to anchor the B-spline basis (default the range of the non-NA data). |
Author(s)
Haiming Zhou and Timothy Hanson
References
Hastie, T. J. (1992) Generalized additive models. Chapter 7 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth & Brooks/Cole.
See Also
Examples
require(stats)
basis <- bspline(women$height, df = 5)
newX <- seq(58, 72, length.out = 51)
# evaluate the basis at the new data
predict(basis, newX)