Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.nsx

Evaluate a Spline Basis


Description

Evaluate a predefined spline basis at given values.

Usage

## S3 method for class 'nsx'
predict(object, newx, ...)

Arguments

object

the result of a call to nsx 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 "nsx". See predict for the general behavior of this function.

See Also

nsx.

Examples

basis <- nsx(women$height, df = 5)
newX <- seq(58, 72, length.out = 51)
# evaluate the basis at the new data
predict(basis, newX)

rstpm2

Smooth Survival Models, Including Generalized Survival Models

v1.5.2
GPL-2 | GPL-3
Authors
Mark Clements [aut, cre], Xing-Rong Liu [aut], Benjamin Christoffersen [aut], Paul Lambert [ctb], Lasse Hjort Jakobsen [ctb], Alessandro Gasparini [ctb], Gordon Smyth [cph], Patrick Alken [cph], Simon Wood [cph], Rhys Ulerich [cph]
Initial release
2021-02-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.