splineMatrix: Spline design matrix.

View source: R/otlse.R

splineMatrixR Documentation

Spline design matrix.

Description

The function builds a matrix for piecewise polynomials fit.

Usage

splineMatrix(X, knots = NA, pFact=0.3, deg=1, method=c("manual","bs"))

Arguments

X

A numeric vector

knots

The piecewise polynomial knots. If set to NA, the knots are set to the p equally spaced quantiles of X. If NULL, the function returns X.

pFact

The number of knots when the argument knots is set to NA if n^pFact, where n is the length of X.

deg

The degree of the piecewise polynomials.

method

Should the method be homemade (manual) of based on the bs function from the splines package?

Examples

data(simData)
X <- splineMatrix(simData$X, quantile(simData$X, c(.25,.5,.75)))

causalOTLSE documentation built on June 9, 2022, 3:02 a.m.