A regression assumption is a condition about the data, errors, or model structure that must hold for linear-regression results to be reliable and interpretable. Validate these conditions before trusting coefficients, significance tests, goodness-of-fit measures, or predictions. section 4.0 section 4.3
Check the following conditions after fitting the model:
- Linearity requires the predictor–response relationship to be adequately represented by a straight line; inspect a residuals plot for random scatter around zero. section 4.2.4
- Independence requires residuals to be uncorrelated with one another; the Durbin–Watson statistic provides a diagnostic check. section 4.2.4
- Homoscedasticity requires residual variance to remain consistent; the Breusch–Pagan test checks for changing variance. section 4.3 section 4.2.4
- Normality requires normally distributed residuals; use a Q–Q plot or the Jarque–Bera test to assess it. section 4.2.4
A practical validation sequence
Fit the regression, inspect the data for outliers and normality, plot fitted values against residuals, and run diagnostic tests. A residuals plot without a curve or funnel pattern supports linearity; Durbin–Watson checks independence, Breusch–Pagan checks variance consistency, and a Q–Q plot or Jarque–Bera test checks residual normality. section 4.2 section 4.2.4
>>> plt.scatter(lm.fittedvalues, lm.resid) #1
>>> plt.axhline(y = 0, color = 'red',
>>> linestyle = '--') #2
>>> plt.title('Residuals Plot') #3
>>> plt.xlabel('Fitted Values') #4
>>> plt.ylabel('Residuals') #5
>>> plt.show() #6
Plot fitted values against residuals with a horizontal zero line to visually assess whether the linearity assumption is plausible. section 4.2.4
