Create linear splines basisSource:
This function creates the basis function of a second-order (linear) splines at a user-specific set of break points.
make_basis( x, xname = "x", internal = NULL, boundary = range(x), degree = 1L, warn = TRUE )
predictor name. Default is
a vector of internal knots, excluding boundary knots
vector of external knots
the degree of the spline. The broken stick model requires linear splines, so the default is
degree = 1. Setting
degree = 0yields (crisp) dummy coding, and one column less than for
degree = 1.
a logical indicating whether warnings from
splines::bs()should be given.
A matrix with
length(x) rows and
length(breaks)columns, with some extra attributes described by
Before version 0.54, it was standard practice that the
array always included