qknots | R Documentation |
Specification of the knots of a cubic B-spline basis for given data.
qknots(x, xmin=NULL, xmax=NULL,
equid.knots = TRUE, pen.order=2, K=25)
x |
data that should be supported by the knots of the B-spline basis. |
xmin |
(Optional) minimum value for the knots. |
xmax |
(Optional) maximum value for the knots. |
equid.knots |
Logical indicating if equidistant knots are desired (Default: TRUE). |
pen.order |
penalty order (if equid.knots = TRUE) (Default: 2). |
K |
number of B-splines in the basis (Default: 25). |
a list containing the following elements:
xmin
: minimum value of the knots.
xmax
: maximum value of the knots.
knots
: vector containing the knots: equidistant if equid.knots
is TRUE, based on quantiles of x
otherwise.
Pd
: penalty matrix for the B-spline coefficients.
pen.order
: penalty order for the P-spline model.
Philippe Lambert p.lambert@uliege.be
Lambert, P. and Kreyenfeld, M. (2025). Time-varying exogenous covariates with frequently changing values in double additive cure survival model: an application to fertility. Journal of the Royal Statistical Society, Series A. <doi:10.1093/jrsssa/qnaf035>
x = rnorm(100)
qknots(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.