Natural Cubic Spline Regression
Natural cubic spline regression represents a predictor's effect by piecewise cubic polynomials joined smoothly at knots and constrained to be linear beyond the boundary knots, fitted by least squares.
자연 3차 스플라인 회귀는 매듭 사이를 3차 다항식으로 부드럽게 잇고 양 끝 밖은 직선으로 제한해 설명변수의 곡선 효과를 적합하는 방법입니다.
How can I include a flexible, curved effect of age in my regression while still adjusting for other covariates and testing nonlinearity?
다른 공변량을 통제하면서 나이 같은 연속 변수의 곡선 효과를 넣고 비선형성을 검정하려면 어떻게 하나요?
A natural cubic spline replaces a predictor with a small set of basis variables so that its effect can curve between knots while staying linear beyond the data range. Nonlinearity is tested by comparing the spline model with a model that has only a linear term.
When to use Natural Cubic Spline Regression
- The effect of a continuous predictor is curved but its shape is not known
- You need to adjust for other covariates in the same linear model
- You want stable behaviour at the ends of the data range
When to use something else
- You need a single interpretable threshold; use segmented (piecewise) regression instead
- The curve is simple and a quadratic suffices; use polynomial regression instead
Assumptions and requirements
- The effect of the predictor is smooth between knots
- Number and placement of knots are adequate
- Errors are independent with constant variance
- The spline is applied to the first predictor; other covariates enter linearly
What the analysis reports
- Fitted curve with confidence band, other covariates held at their means
- Knot locations and spline degrees of freedom
- F test of nonlinearity against a linear term
- R² and AIC for spline and linear models
- Coefficients for linear covariates
How to report it
A natural cubic spline with [value] degrees of freedom for [predictor] improved fit over a linear term, F([df1], [df2]) = [value], p = [value]; [outcome] increased steeply up to [value] and then flattened.
Related methods
Run Natural Cubic Spline Regression on Quorant
- Data you need
- a table (CSV or Excel) with an outcome variable and predictor (feature) columns
- Price
- 400 credits for one analysis up to 10,000 rows (complexity level 3); larger or wider data costs more. Optional methodologist review: 1800 credits.
- Checking
- Checked by property tests in every deployment
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.