Using Stata v9 to model complex non-linear relationships with restricted cubic splines
William D. Dupont
Restricted cubic splines (RCSs) are used with generalized linear models and other regression methods to model complex non-linear relationships. A RCS with k knots is linear before the first and after the last knot, is a cubic polynomial between adjacent knots, and is continuous and smooth. A RCS model with k knots can be fitted with only k-1 covariates. rc_spline calculates these covariates from an independent covariate and the knot values. Default numbers of knots and/or knot values suggested by Harrell (2001) may be used. We can then use the full power of Stata v9 to build models, construct graphs, and perform residual analyses using these covariates. RCSs are illustrated by modeling length of stay (LOS) and discharge mortality as a function of admission blood pressure (BP) from the SUPPORT study. LOS and log-odds of death are highly non-linear functions of BP. Multiple linear and logistic regression with RCSs are used to model these data. Plots of expected outcome with 95% confidence bands are easily overlaid on scatterplots using standard Stata graphics. These regression curves are little affected by the knot placements. This robust methodology is easily taught to non-statisticians and greatly expands the modeling capacity of standard regression methods.
In order to set up a list of libraries that you have access to,
you must first login
or sign up.
Then set up a personal list of libraries from your profile page by
clicking on your user name at the top right of any screen.