predict.bs

Evaluate a Spline Basis

Evaluate a predefined spline basis at given values.

Keywords
smooth
Usage
# S3 method for bs
predict(object, newx, …)

# S3 method for ns predict(object, newx, …)

Arguments
object

the result of a call to bs or ns having attributes describing knots, degree, etc.

newx

the x values at which evaluations are required.

Optional additional arguments. At present no additional arguments are used.

Value

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

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

See Also

bs, ns, poly.

Aliases
  • predict.bs
  • predict.ns
Examples
library(splines) # NOT RUN { require(stats) basis <- ns(women$height, df = 5) newX <- seq(58, 72, length.out = 51) # evaluate the basis at the new data predict(basis, newX) # }
Documentation reproduced from package splines, version 3.5.2, License: Part of R 3.5.2

Community examples

Looks like there are no examples yet.