rcs | R Documentation |
Takes a numeric vector and a sequence of knots to generate restricted cubic splines basis columns based on a truncated power series (as described in section 2.4.5 of the second edition of Regression Modeling Strategies by Frank E. Harrrell, Jr).
rcs(x, knots = stats::quantile(x, probs = c(0, 0.1, 0.5, 0.9, 1)))
x |
numeric vector |
knots |
numeric vector including at least 3 unique knot locations of increasing order, with the outer ones indicating the boundary knots. |
matrix of basis columns
rcs(1:25)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.