predictSpline | R Documentation |
Predict a spline function by specifying its type, knots, degree and coefficients
predictSpline (object, x, ...)
## Default S3 method:
predictSpline(object=c("b-spline", "tp-spline"),
x, knots, degree, keep.duplicates = FALSE, coef=1, ... )
object |
the type of spline to be predicted ("b-spline", the default, or "tp-spline") |
x |
Vector of values at wich to predict the spline function. |
knots, degree |
knots and degree of the relational model. |
keep.duplicates |
Should duplicate interior knots be kept or removed. Defaults is |
coef |
vector of coefficient of the spline function. |
... |
not used |
predictSpline
.
A vector the evaluated spline function with same length as x.
predict.flexrsurvclt
, flexrsurv
, flexrsurvclt
predspline <- predictSpline("b-spline",
x= seq(from=-3, to = 3, by=.1),
coef = .5 * 1:5,
knots=c(-3,0,3), degree=3)
plot(seq(from=-3, to = 3, by=.1), predspline)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.