| bs_term | R Documentation |
Term for a B-Spline Basis for Polynomial Splines
bs_term(
x = numeric(),
df = NULL,
knots = NULL,
degree = 3,
intercept = FALSE,
Boundary.knots = range(if (use_log) log(x) else x),
use_log = FALSE
)
x, df, knots, degree, intercept, Boundary.knots |
same as |
use_log |
|
A list like bs with an additional element called eval
to evaluate the basis. See VAJointSurv-terms.
poly_term, ns_term, weighted_term,
and stacked_term.
vals <- c(0.41, 0.29, 0.44, 0.1, 0.18, 0.65, 0.29, 0.85, 0.36, 0.47)
spline_basis <- bs_term(vals,df = 3)
# evaluate spline basis at 0.5
spline_basis$eval(0.5)
# evaluate first derivative of spline basis at 0.5
spline_basis$eval(0.5, der = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.