VerifiedEvidence: highv1.0.0

Restricted Cubic Spline

A flexible function of piecewise cubic segments joined smoothly at knots, constrained to behave linearly beyond the outermost knots.

Last reviewedDarrin Baines IP Ltd

Concept Architecture

Concept

Theoretically, a Restricted Cubic Spline is a flexible regression modelling technique used to represent continuous relationships without assuming linearity. It consists 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, a restricted cubic spline is 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 spline captures 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 14: Survival analysis for economic evaluations alongside clinical trials – extrapolation with patient-level data — Nicholas R. Latimer, TSD 14 ed., 2013 (NICE Decision Support Unit (University of Sheffield))

    The reference guidance on survival analysis for economic evaluation: fitting standard parametric models (exponential, Weibull, Gompertz, log-logistic, log-normal) to censored trial data and extrapolating to estimate lifetime survival benefit, with a process guide for model selection and justification.

Frequently Asked Questions (6)

  • What is a restricted cubic spline?

    A flexible function of piecewise cubic segments joined smoothly at knots, constrained to behave linearly beyond the outermost knots.

    Source: Royston & Parmar 2002

  • What does the restriction in a restricted cubic spline do?

    An ordinary cubic spline can behave erratically beyond the range of the data, curving wildly where there is little to constrain it. The restriction forces the spline to become a straight line beyond its outermost knots, taming this behaviour so the fitted function extends sensibly into sparse regions and the tails. This is particularly valuable in survival analysis, where the tail governs extrapolation and unchecked curvature would give implausible projections. The constraint trades a little flexibility at the ends for stability. Royston and Parmar (2002) apply this.

    Source: Royston & Parmar 2002

  • Why are cubic splines restricted at the tails?

    Cubic splines are restricted to be linear beyond the outermost knots because unconstrained cubic splines can behave erratically at the extremes of the data, where information is sparse, producing implausible curves or wild extrapolation. Forcing the function to be linear in the tails stabilises its behaviour there, giving 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 implausible hazards beyond the data.

    Source: Royston & Parmar 2002

  • How do restricted cubic splines work?

    Restricted cubic splines work by dividing the range of a variable at knots and fitting cubic polynomial segments between them, joined smoothly so the function and its derivatives are continuous, with the segments beyond the outer knots constrained to be linear. The number and placement of knots control the flexibility, more knots allowing more complex shapes. The resulting smooth, flexible function can follow non-linear patterns within the data while behaving linearly at the tails, making it suitable for modelling complex relationships.

    Source: Collett 2015

  • Where are restricted cubic splines used in survival analysis?

    In survival analysis, restricted cubic splines are used in flexible parametric survival models, such as those of Royston and Parmar, to represent a transformation of survival, like the log cumulative hazard, as a smooth spline function of log time. This lets the modelled hazard take complex shapes that standard distributions cannot, while the linear tail restriction gives more stable extrapolation. Restricted cubic splines thus provide the flexibility of these models, with the number and placement of knots controlling the hazard's shape.

    Source: Royston & Parmar 2002

  • What are the advantages of restricted cubic splines?

    Restricted cubic splines offer flexibility to model non-linear relationships and complex hazard shapes smoothly, while the linear constraint at the tails guards against the erratic behaviour and implausible extrapolation of unconstrained splines, giving more stable estimates at the extremes. They provide a good balance between flexibility within the data and reasonable behaviour beyond it, which is valuable in survival extrapolation. This combination makes restricted cubic splines a widely used tool for flexible modelling where both fit and sensible tail behaviour matter.

    Source: Royston & Parmar 2002

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-071

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