Evaluate a predefined spline basis at new values

Usage

predict.bs(basis, newx)
predict.ns(basis, newx)

Arguments

basis the result of a call to bs() or ns(), in particular, having attributes describing knots, degree etc.
newx the x values at which evaluations are required.

Value

an object just like basis, except evaluated at the new values of x.

These are methods for the function predict() for objects inheriting from classes bs or ns. See predict for the general behavior of this function.

See Also

bs, ns, poly, lo, s

Examples

basis <- ns(x, knots=c(3,6), B=c(0,5)) #generate a basis
basis.eval <- predict(basis, newx)


[Package Contents]