When to use restricted cubic spline?

When to use restricted cubic spline?

Restricted cubic splines provide a useful tool for the analysis of the effect of a continuous predictor on an outcome. They allow for great flexibility in the form of the relationship between predictor and outcome.

What is a spline model?

In mathematics, a spline is a special function defined piecewise by polynomials. Splines are popular curves in these subfields because of the simplicity of their construction, their ease and accuracy of evaluation, and their capacity to approximate complex shapes through curve fitting and interactive curve design.

What is the spline function in Excel?

Spline fitting or spline interpolation is a way to draw a smooth curve through n+1 points (x0, y0), …, (xn,yn). Thus, we seek a smooth function f(x) so that f(xi) = yi for all i. In particular, we seek n cubic polynomials p0, …, pn-1 so that f(x) = pi(x) for all x in the interval [xi, xi+1].

How to do a restricted cubic regression in SAS?

Restricted cubic splines are also called “natural cubic splines.” This section shows how to perform a regression fit by using restricted cubic splines in SAS. For the example, I use the same Sashelp.Cars data that I used in the previous article.

How are restricted cubic splines used in logistic regression?

Restricted cubic splines are just a transformation of an independent variable. Thus, they can be used not only in ordinary least squares regression, but also in logistic regression, survival analysis, and so on.

How to use splines in a regression analysis?

This is the modern way to use splines in a regression analysis in SAS, and it replaces the need to use older macros such as Frank Harrell’s %RCSPLINE macro. I shared my blog post with a colleague at SAS and mentioned that the process could be simplified.

How to do restricted cubic in Proc GLMSELECT?

The following call to PROC GLMSELECT includes an EFFECT statement that generates a natural cubic spline basis using internal knots placed at specified percentiles of the data. The MODEL statement fits the regression model and the OUTPUT statement writes an output data set that contains the predicted values.