[R] get the value of a biplane
ruipbarradas at sapo.pt
Sun May 28 18:37:07 CEST 2017
Since function splines::bs returns an object of class bs in order to
read the help page for function predict you need
The syntax would be
## S3 method for class 'bs'
predict(object, newx, ...)
Please read that help page and maybe you'll get the answer you need.
Hope this helps,
Em 28-05-2017 15:51, Glenn Schultz escreveu:
> If is specify a spline basis as follows
> knots <- c(6, 12, 22, 30, 35)
> x <- c(0.0, .25, 1.0, 2.0, 3.0)
> SCurve <- bs(x = x, knots = knots, intercept = FALSE, Boundary.knots =
> I would like to now get the spline value for new values of x. However,
> when I use predict the new basis is returned and I would like to get the
> value. Nothing has worked so far and ?predict plus examples only show
> prediction from linear models. Is there a way to extract the value from
> a defined spline?
> Best Regards,
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help