predictSpline {flexrsurv} | R Documentation |
Generic method for prediction of spline function
Description
Predict a spline function by specifying its type, knots, degree and coefficients
Usage
predictSpline (object, x, ...)
## Default S3 method:
predictSpline(object=c("b-spline", "tp-spline"),
x, knots, degree, keep.duplicates = FALSE, coef=1, ... )
Arguments
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 |
Details
predictSpline
.
Value
A vector the evaluated spline function with same length as x.
See Also
predict.flexrsurvclt
, flexrsurv
, flexrsurvclt
Examples
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)
[Package flexrsurv version 2.0.18 Index]