This package provides a method for nonparametric regression that
combines the (global) approximation power of regression splines for
continuous predictors (‘
x’) with the (local) power of
kernel methods for categorical predictors (‘
user also has the option of instead using indicator bases for the
categorical predictors. When the predictors contain both continuous
and categorical (discrete) data types, both approaches offer more
efficient estimation than the traditional sample-splitting
(i.e. ‘frequency’) approach where the data is first broken into
subsets governed by the categorical
To cite the crs package type: ‘
(without the single quotes).
For a listing of all routines in the crs package type:
For a listing of all demos in the crs package type:
For a ‘
vignette’ that presents an overview of the
crs package type: ‘
For the continuous predictors the regression spline model employs the B-spline basis matrix using the B-spline routines in the GNU Scientific Library (http://www.gnu.org/software/gsl/).
tensor.prod.model.matrix function is used to
construct multivariate tensor spline bases when
and uses additive B-splines otherwise (i.e. when
For the discrete predictors the product kernel function is of the ‘Li-Racine’ type (see Li and Racine (2007) for details) which is formed by constructing products of one of the following univariate kernels:
l(z[i],z,lambda) = 1 if z[i] = z, and lambda if z[i] != z. Note that lambda must lie between 0 and 1.
l(z[i],z,lambda) = 1 if |z[i] - z| = 0, and lambda^|z_i-z| if |z[i] - z|>=1. Note that lambda must lie between 0 and 1.
Alternatively, for the ordinal/nominal predictors the regression spline model will use indicator basis functions.
Maintainer: Jeffrey S. Racine email@example.com
I would like to gratefully acknowledge support from the Natural Sciences and Engineering Research Council of Canada (http://www.nserc.ca), the Social Sciences and Humanities Research Council of Canada (http://www.sshrc.ca), and the Shared Hierarchical Academic Research Computing Network (http://www.sharcnet.ca).
Li, Q. and J.S. Racine (2007), Nonparametric Econometrics: Theory and Practice, Princeton University Press.
Ma, S. and J.S. Racine and L. Yang (under revision), “Spline Regression in the Presence of Categorical Predictors,” Journal of Applied Econometrics.
Ma, S. and J.S. Racine (2013), “Additive Regression Splines with Irrelevant Categorical and Continuous Regressors,” Statistica Sinica, Volume 23, 515-541.