Regression assumptions and diagnostics
A regression model always produces coefficients and p-values. Whether you can trust them depends on its assumptions. This lesson covers each one, how to check it, and what to do when it fails, using a real multiple regression as the running example.
The example model
Fuel economy for 32 cars (R’s mtcars) predicted from weight, horsepower and number of cylinders. The full analysis is in multiple regression. These are the diagnostics Analytika computes with the fit:
=== DIAGNOSTICS === VIF wt: 2.581 VIF hp: 3.496 VIF cyl_6: 1.804 VIF cyl_8: 6.230 Breusch-Pagan p (homoscedasticity): 0.1868 Residual normality p: 0.2263 Influential observations (Cook's D > 4/n): 2 Linearity RESET p: 0.0302
1. Linearity
The outcome should change linearly with each predictor, holding the others constant.
- Check: plot residuals against fitted values, and against each predictor. A curve means a non-linear relationship. The Ramsey RESET test asks whether squared and cubed fitted values improve the fit.
- Here: RESET p = .030, some evidence of remaining curvature. In the weight-only model, fuel economy falls off faster for light cars than a straight line allows, and the same bend is the likely cause here.
- Fix: add a curved term (weight²), transform a variable (such as log), or use a more flexible model.
2. Independence of errors
One case’s residual shouldn’t predict another’s. This is violated by repeated measures, clustering (pupils in schools) and time series.
- Check: think about the design first. For data ordered in time, the Durbin-Watson statistic tests for correlation between consecutive residuals. It’s meaningless when row order is arbitrary, as with these cars.
- Fix: mixed-effects models or clustered standard errors for grouped data, and time-series models for temporal data.
3. Homoscedasticity (constant variance)
The spread of residuals should be similar at every level of the fitted values.
- Check: in a residuals-vs-fitted plot, look for a funnel shape where the spread widens. The Breusch-Pagan test formalises this.
- Here: Breusch-Pagan p = .19, no evidence of a problem.
- Fix: robust (heteroscedasticity-consistent) standard errors, a transformation of the outcome, or weighted least squares.
4. Normality of residuals
- Check: a Q-Q plot of residuals, or a normality test. Only the residuals need to be normal, not the outcome or predictors.
- Here: p = .23, fine.
- How much it matters: least of the assumptions with moderate samples, because coefficients’ sampling distributions become normal anyway. Most important in small samples and for prediction intervals.
5. No severe multicollinearity
When predictors are strongly correlated with each other, the model can’t separate their effects. Coefficients become unstable and standard errors inflate.
- Check: the variance inflation factor (VIF). 1 means no overlap with other predictors. Values above 5 deserve a look, and above 10 usually indicate a real problem.
- Here: weight (2.58) and horsepower (3.50) are fine. The 8-cylinder dummy (6.23) overlaps heavily with weight and power, which is why its confidence interval is so wide.
- Fix: drop or combine redundant predictors, collect more data, or accept wide intervals for the overlapping terms. Centring helps only for interaction and polynomial terms.
6. No dominating influential points
- Check: Cook’s distance combines how unusual a case is with how far it pulls the line. Cases above 4/n are commonly flagged.
- Here: two cars are flagged. Refit without them and see whether the conclusions change.
- Fix: investigate before removing anything. See outliers.
What Analytika does with diagnostics
Analytika computes all of these with every linear model and lists problems as caveats beside the results. It doesn’t silently switch to a different model, because choices like adding a curve or transforming the outcome are modelling decisions you should make and justify. The model family itself (linear, logistic, ordinal, count) is chosen from your outcome’s type. See regression analysis.
Reporting
Diagnostics indicated no problems with homoscedasticity (Breusch-Pagan p = .19) or residual normality (p = .23); variance inflation factors ranged from 1.80 to 6.23. A RESET test suggested some non-linearity (p = .030), discussed as a limitation.
More in Regression
Run this on your own data
Upload a dataset and ask your question in plain English. Analytika checks the assumptions, picks the test, runs it, and writes the results up in APA format.