This function just calls bs() from the
splines
package.
Usage
bs(x, df = NULL, knots = NULL, degree = 3, intercept = FALSE,
Boundary.knots = range(x), warn.outside = TRUE)Arguments
- x
the predictor variable. Missing values are allowed.
- df
degrees of freedom; one can specify
dfrather thanknots;bs()then choosesdf-degree(minus one if there is an intercept) knots at suitable quantiles ofx(which will ignore missing values). The default,NULL, takes the number of inner knots aslength(knots). If that is zero as per default, that corresponds todf = degree - intercept.- knots
the internal breakpoints that define the spline. The default is
NULL, which results in a basis for ordinary polynomial regression. Typical values are the mean or median for one knot, quantiles for more knots. See alsoBoundary.knots.- degree
degree of the piecewise polynomial—default is
3for cubic splines.- intercept
if
TRUE, an intercept is included in the basis; default isFALSE.- Boundary.knots
boundary points at which to anchor the B-spline basis (default the range of the non-
NAdata). If bothknotsandBoundary.knotsare supplied, the basis parameters do not depend onx. Data can extend beyondBoundary.knots.- warn.outside
logicalindicating if awarningshould be signalled in case somexvalues are outside the boundary knots.
