VerifiedEvidence: highv1.0.0

Restricted Cubic Splines

A collection of piecewise cubic functions joined at knots and constrained to extend linearly beyond the data range, used to model non-linear hazard shapes.

Last reviewedDarrin Baines IP Ltd

Concept Architecture

Concept

Theoretically, Restricted Cubic Splines are flexible regression modelling techniques used to represent continuous relationships without assuming linearity. They consist of piecewise cubic polynomials joined smoothly at predefined knot locations, with constraints imposed beyond the boundary knots so that the function is linear in the tails. Restricted cubic splines are widely used in survival analysis and health economics to model complex non-linear effects while avoiding unrealistic behaviour at the extremes of the data.

Mathematically, restricted cubic splines are constructed from cubic basis functions defined by selected knot locations. Linear constraints are imposed on the first and second derivatives beyond the outer knots, producing a smooth function that remains linear outside the observed range. Regression coefficients associated with the spline basis functions are estimated using maximum likelihood or least squares methods within the chosen statistical model.

In practice, restricted cubic splines are implemented by selecting the number and placement of knots, generating spline basis functions and estimating their coefficients within regression or survival models. They are commonly applied in flexible parametric survival models, prognostic modelling, dose-response analyses and health economic extrapolation to capture non-linear relationships between predictors and outcomes.


Purpose

Used to model non-linear relationships between continuous variables, improve regression and survival model fit, support flexible hazard modelling and reduce bias arising from inappropriate linear assumptions.


Mathematical Formulae

Primary Formula

f(x) = ?? + ??x + ????? ??B?(x)

Where:

f(x) = fitted spline function

??, ??, ?? = estimated regression coefficients

B?(x) = restricted cubic spline basis functions

K = number of spline basis functions

Supporting Formulae

Spline basis function:

B?(x) = d?(x) ? d???(x)

where d?(x) represents the truncated cubic basis function defined by the selected knot locations.

There is no single universally adopted canonical basis function because equivalent parameterisations are used across statistical software.

Related Mathematical Methods

  • Spline regression
  • Flexible parametric survival modelling
  • Royston?Parmar modelling
  • Generalised additive models
  • Maximum likelihood estimation
  • Cox proportional hazards regression

Example

A health economist models age as a predictor of mortality in a survival model using five knots located at the 5th, 27.5th, 50th, 72.5th and 95th percentiles of the observed age distribution. The restricted cubic splines capture the increasing hazard at older ages without assuming a constant linear increase, improving model fit and long-term survival extrapolation.


Excel Implementation

FunctionExample FormulaHealth Economics Application
IF=IF(A2>Knot1,(A2-Knot1)^3,0)Creates truncated cubic basis functions.
MAX=MAX(A2-Knot1,0)^3Generates spline basis components.
LINEST=LINEST(Y2:Y100,BasisRange,TRUE,TRUE)Estimates regression coefficients for spline terms.
MMULT=MMULT(BasisRange,CoefficientRange)Calculates fitted spline values.

VBA (Optional)

VBA can automate spline basis generation, knot placement and prediction of fitted values for survival and regression models.


Sources

Harrell FE. Regression Modeling Strategies. 2nd ed. Springer; 2015.

Royston P, Sauerbrei W. Multivariable Model-Building. Wiley; 2008.

Royston P, Parmar MKB. Flexible parametric proportional-hazards and proportional-odds models for censored survival data. Statistics in Medicine. 2002;21:2175?2197.

Briggs A, Claxton K, Sculpher M. Decision Modelling for Health Economic Evaluation. Oxford University Press; 2006.

NICE. Health Technology Evaluations: The Manual. National Institute for Health and Care Excellence; 2022.

Library

Publications

1
  • Guidance

    NICE DSU Technical Support Document 15: Cost-effectiveness modelling using patient-level simulation — Davis, Stevenson, Tappenden & Wailoo, TSD 15 ed., 2014 (NICE Decision Support Unit (University of Sheffield))

    Guidance on individual patient-level (microsimulation) cost-effectiveness modelling — when to use it in preference to cohort models, how to structure it, and how to handle the associated computational and uncertainty challenges.

Frequently Asked Questions (6)

  • What are restricted cubic splines?

    A collection of piecewise cubic functions joined at knots and constrained to extend linearly beyond the data range, used to model non-linear hazard shapes.

    Source: Royston & Parmar 2002

  • How do restricted cubic splines represent a changing hazard?

    Restricted cubic splines model a hazard that changes shape over time by joining several cubic pieces at knots, each piece free to curve differently, so the combined function can rise, fall, and turn as the data require. More knots allow more turning points and a closer following of complex patterns, while fewer give a smoother, simpler shape. This adjustable flexibility, held stable at the tails by the linear restriction, is what lets them capture non-monotonic hazards. The number and position of knots set the balance. Royston and Parmar (2002) describe this.

    Source: Royston & Parmar 2002

  • Why are restricted cubic splines constrained to be linear at the tails?

    Restricted cubic splines are constrained to be linear beyond the outermost knots because unconstrained cubic splines can behave erratically at the extremes, where data are sparse, producing implausible curves and unstable extrapolation. Forcing linearity in the tails gives more sensible values at and beyond the boundary knots. This restriction is particularly valuable in survival models used for extrapolation, since it prevents the spline from projecting wild or implausible hazards beyond the observed data.

    Source: Collett 2015

  • How do restricted cubic splines model non-linear hazards?

    Restricted cubic splines model non-linear hazards by representing a transformation of survival, such as the log cumulative hazard, as a flexible spline function of log time, with cubic segments joined at knots that let the function bend to follow the hazard's shape. The number and placement of knots control how complex a hazard can be captured. This lets the modelled hazard take shapes, including turning ones, that standard parametric distributions cannot, while the linear tails give stable behaviour for extrapolation.

    Source: Royston & Parmar 2002

  • How does the number of knots affect restricted cubic splines?

    The number of knots affects restricted cubic splines by controlling their flexibility: more knots allow the spline to bend more often and capture more complex hazard shapes, improving fit within the data, but risk overfitting and implausible extrapolation, while fewer knots give a smoother, more constrained function less prone to overfitting but possibly missing real structure. Choosing the number of knots balances flexibility against parsimony and reliable extrapolation, which matters in survival models projected beyond the data.

    Source: Royston & Parmar 2002

  • Where are restricted cubic splines used?

    Restricted cubic splines are used to model non-linear relationships in regression and, prominently, in flexible parametric survival models such as those of Royston and Parmar, where they represent the log cumulative hazard as a smooth spline of log time. This lets the hazard take complex shapes beyond standard distributions, with the linear tails giving stable extrapolation. They are also used to model non-linear covariate effects. Their flexibility with controlled tail behaviour makes them valuable where both fit and sensible extrapolation matter.

    Source: Collett 2015

Trust Record

Verified by Dr Darrin Baines

British health economist

Professional identity: darrinbaines.org

Verification date: 23 Oct 2025

Content version: 1.0.0

Canonical Identity

Term code
HE-EM-SM-072

Stable URI · Machine-readable · Resolvable · CC BY 4.0