Understand the idea
A straight-line model assumes that going from age 20 to 21 changes the outcome by the same amount as going from age 60 to 61. If the real relationship speeds up, slows down, or reverses direction somewhere in the range, a straight line describes none of those regions well and its coefficient is a compromise that fits none of the data.
The giveaway is the residual plot: plot the leftover error against each predictor (or against the fitted values). A random scatter with no pattern is what a straight-line fit should leave behind. A curve, a U-shape, or a fan shape in that plot means the model is missing bend that the straight line cannot capture.
The fix is often small: add a squared term, use a spline, or transform the predictor (log of income instead of raw income), rather than abandoning regression altogether. Curvature is common and usually easy to accommodate once it is seen.
The linearity assumption says a straight line (or, in logistic regression, a straight line on the log-odds scale) fairly describes how the outcome moves with each predictor. The usual check is a residual vs fitted plot: if the points form a curve instead of a shapeless band around zero, the relationship is not straight. The RESET test and the Box-Tidwell test are formal checks for curvature: RESET for ordinary regression, and Box-Tidwell for a numeric predictor in logistic regression.
Practitioner explanation
For OLS the assumption is E[Y|X] = X*beta, i.e. the CONDITIONAL MEAN is linear in the parameters (a quadratic term or spline basis still counts as 'linear' in this sense, since the model is linear in beta). Violation biases every coefficient whose predictor is correlated with the omitted curvature, not only the mismodeled one, and the direction of the bias is not predictable from the plot alone.
For logistic regression the corresponding requirement is linearity in the LOG-ODDS, which the raw scatterplot cannot show because the response is binary; KernelStats runs a Box-Tidwell-STYLE check instead: it adds a SQUARED term for each continuous predictor and compares the augmented model with the fitted one by a likelihood-ratio test; a significant improvement indicates curvature on the logit scale. (The classical Box-Tidwell test adds x*ln(x) instead; the two usually agree, but they are different tests.)
For OLS, KernelStats does not run a formal linearity test; the residual-vs-fitted plot on the regression card is the diagnostic, and Ramsey's RESET test or a fitted spline comparison are reasonable manual follow-ups this tool does not automate. Reporting must say which check was used, since 'linearity was checked' means something different for the two model families.
When to use it
Consider it when
Check it for every OLS or logistic regression with continuous predictors, before trusting the coefficient's single-number summary of the relationship.
Use caution when
Do not read a clean residual plot as proof for a predictor that was never examined individually: a global plot can hide curvature in one variable that partly cancels curvature in another.
Formulas and symbols
Squared-term linearity check (logistic regression)
KernelStats adds a squared term for every continuous predictor and tests all of them together by a likelihood-ratio test; a significant result indicates the effect on the log-odds is not linear. The classical Box-Tidwell version uses x ln(x) in place of x^2.
Alternatives
- Polynomial Regression. The residual-vs-fitted plot shows clear, single-bend curvature that a squared or cubic term can capture.
- Spline Regression. The curvature is more complex than a low-order polynomial can follow, or its shape is not known in advance.
- Generalized Additive Model (GAM). Several predictors each need their own flexible, data-driven shape rather than one global polynomial form.
Worked example
Scenario
Predicting reaction time from age using a simple straight-line model, when the true relationship flattens after age 40.
Result
The residual-vs-fitted plot shows a shallow U-shape: positive residuals at both low and high fitted values, negative in the middle.
Interpretation
The straight line understates reaction time at the extremes of age and overstates it in the middle. Adding an age-squared term or fitting a spline removes the pattern and the coefficient on age becomes interpretable only alongside the curvature term, not on its own.
Common misconceptions
Misconception
A high R-squared means the linearity assumption was fine.
Correction
R-squared measures how much variance is explained overall; it can stay high with meaningful curvature present, especially when other predictors and a large sample absorb the fit. Linearity is checked by the shape of the residual plot, not by the size of R-squared.
References
- NIST/SEMATECH e-Handbook of Statistical Methods, §4.4.3.2 Linear regression assumptions, NIST/SEMATECH (2012), §4.4.3.2.
