crSpline: Generate a Basis Matrix for Penalized Cubic Regression...

Description Usage Arguments Value

View source: R/sdrtools.R

Description

The function has a usage similar to bs and ns in the splines package. However, this function utilizes smooth constructor in the package mgcv to construct cubic regression splines with an optional penalty.

Usage

1
crSpline(x, df = 5, knots = NULL, intercept = FALSE, fx = FALSE, S = NULL)

Arguments

x

the predictor variable. Missing values are allowed.

df

degrees of freedom of the basis matrix. The default is 5. The minimum allowed is 3.

knots

breakpoints that define the spline. by default these are automatically selected, and not defined by the user.

intercept

If TRUE, an intercept is included in the basis matrix.

fx

If TRUE, it removes the penalization.

S

penalty matrix, defined internally if NULL (the default).

Value

A matrix with class "cr" and class "basis".


abnormally-distributed/cvreg documentation built on May 3, 2020, 3:45 p.m.