powered by
Makes truncated power basis spline functions.
tpb(x, degree = 3, nknots = 3, knot_loc = NULL)
A n x degree+nknots matrix of basis function values.
degree
nknots
Vector of values that will be transformed by the basis functions.
Degree of the polynomial used by the basis function.
Number of knots to use in the spline.
Location of the knots. If NULL they will be placed evenly along the appropriate quantiles of the variable.
NULL
library(psre) data(wvs) smod3 <- lm(secpay ~ tpb(gini_disp, degree=3, knot_loc=.35) + democrat, data=wvs) summary(smod3)
Run the code above in your browser using DataLab