View source: R/makesplineParams.R
makesplineParams | R Documentation |
This function makes a list object containing all of the information to fit splines to continuous data.
makesplineParams(
data,
varlist,
predictionData = NULL,
degree = NULL,
spl_all = NULL
)
data |
Data frame containing columns of covariates listed in |
varlist |
Vector of variable names for the covariates of interest |
predictionData |
Data frame containing columns of covariates listed in |
degree |
Vector specifying the degree of the spline. If unspecified, degree 2 is stored. |
The information is stored in list slots [[2]]
and onward (slot [[1]]
is reserved for a spatial term). Specifically:
covar
. Name of covariate.
explanatory
. Vector of covariate data.
knots
. Knot(s) for spline fitting. This function initialises with a knot at the mean covariate value.
bd
. This specifies the boundary knots. If predictionData
is NULL
then this is the range of the covariate data. Otherwise, the boundary knots are the maximum combined range of the data and prediction data.
degree
. The degree of a B-spline. This function retuns 2 by default.
See runSALSA2D
for details on the spatial slot ([[1]]
)
# load data
data(ns.data.re)
# load prediction data
data(ns.predict.data.re)
splineParams<- makesplineParams(ns.data.re, varlist=c('observationhour', 'DayOfMonth'),
predictionData=ns.predict.data.re)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.