BIOSTATISTICS • REGRESSION & MODELING

Checking Regression Assumptions — Check assumptions (linearity, independence, normality, equal variance)

Valid regression inference depends on verifying four critical assumptions about residual behavior and data structure.

Historical Context & Motivation

Regression analysis is among the most widely used statistical methods in biomedical research, yet the validity of its results hinges on a set of mathematical conditions that must be satisfied for standard inference—confidence intervals, p-values, and prediction intervals—to hold. The formal study of these conditions traces back to the early development of ordinary least squares (OLS) estimation, and researchers have spent over a century refining both the theoretical foundations and the practical diagnostic tools used to evaluate them. Understanding why these assumptions exist, and how violations distort results, is essential for any researcher conducting or interpreting regression-based analyses in the health sciences.

1805
Legendre Introduces Least Squares
Adrien-Marie Legendre publishes the method of least squares for fitting linear models to astronomical data, implicitly assuming a linear relationship and well-behaved errors.
1809
Gauss Connects Least Squares to Normality
Carl Friedrich Gauss derives the least squares estimator under the assumption of normally distributed errors, establishing the theoretical link between the method and the normality assumption.
1922
Gauss–Markov Theorem Formalized
The Gauss–Markov theorem proves that OLS yields the best linear unbiased estimator (BLUE) when errors are uncorrelated and have equal variance—formalizing the independence and homoscedasticity assumptions.
1973
Anscombe's Quartet Published
Francis Anscombe demonstrates four datasets with identical summary regression statistics but dramatically different scatter plots, powerfully illustrating that numerical summaries alone cannot validate assumptions.
1990s–Present
Modern Diagnostic Tools
Software packages in R, SAS, and Python make residual diagnostics, Q–Q plots, and formal tests (e.g., Breusch–Pagan, Durbin–Watson) accessible to applied researchers across biostatistics and epidemiology.

The central question this lesson addresses is: How do we verify that the mathematical conditions underlying a regression model are met, and what do we do when they are not? In biostatistics, where models inform clinical decisions, drug dosage calculations, and epidemiological policy, a regression model that violates its assumptions can yield misleading coefficient estimates, inflated confidence, and ultimately flawed conclusions about biological relationships.

Core Principles — The LINE Assumptions

The four classical assumptions of ordinary least squares regression are commonly remembered by the mnemonic LINE: Linearity, Independence, Normality, and Equal variance. Each assumption pertains to properties of the residuals (the differences between observed and predicted values), not to the raw data themselves. When all four hold simultaneously, OLS provides the best linear unbiased estimator, and the standard formulas for standard errors, t-tests, and F-tests are valid.

1

Linearity

The true relationship between the predictor(s) and the outcome is linear in the parameters. The expected value of Y given X falls on a straight line (or hyperplane in multiple regression). Violations produce systematic patterns in residual plots.
2

Independence

The residuals are independent of one another—knowing one residual provides no information about another. This assumption is violated in time-series data, clustered designs, or repeated-measures studies without appropriate modeling.
3

Normality

The residuals follow a normal (Gaussian) distribution at each level of the predictor. This assumption is most critical for inference in small samples; with large n, the Central Limit Theorem provides robustness.
4

Equal Variance (Homoscedasticity)

The variance of the residuals remains constant across all levels of the predictor(s). When variance changes systematically—called heteroscedasticity—standard errors are biased, making confidence intervals and hypothesis tests unreliable.
KEY TAKEAWAY
Think of the LINE assumptions as the fine print on a contract. The OLS method promises to give you the best, most efficient estimates—but only if the four conditions are met. Just as an insurance policy becomes void if terms are violated, the guarantees of OLS (unbiasedness, minimum variance, valid inference) break down when assumptions fail. The regression output might still appear numerical and precise, but the numbers you trust—p-values, confidence intervals—may be quietly misleading.

Visual Explanation — Residual Diagnostic Plots

The primary tool for evaluating regression assumptions is the residual plot—a scatter plot of residuals (ê) on the vertical axis against fitted values (ŷ) or predictor values on the horizontal axis. A well-behaved model produces a residual plot with no discernible pattern: points scatter randomly around zero in a roughly constant horizontal band. The diagram below contrasts a model that satisfies assumptions with three common violation patterns.

Four residual plot patterns. Top-left: random scatter indicates assumptions are met. Top-right: a curved (U-shaped) pattern signals nonlinearity. Bottom-left: a fanning pattern reveals heteroscedasticity (unequal variance). Bottom-right: extreme outlier residuals suggest non-normal error distributions.

In practice, you should generate these plots immediately after fitting any regression model. The residual-versus-fitted plot (top panels) addresses linearity and equal variance simultaneously: a systematic curve indicates non-linearity, while a fanning pattern indicates heteroscedasticity. Extreme residuals far from the horizontal band (bottom-right panel) raise concerns about normality. The independence assumption typically cannot be assessed from a residual-versus-fitted plot alone; it requires knowledge of the study design or time-ordered residual plots.

Mathematical Framework

The simple linear regression model is expressed as a data-generating process with explicit conditions on the error term. These conditions are precisely the LINE assumptions expressed in mathematical notation. The model and its assumptions together determine the statistical properties of the OLS estimators β̂₀ and β̂₁.

SIMPLE LINEAR REGRESSION MODEL
Yᵢ = β₀ + β₁Xᵢ + εᵢ
Yᵢ = observed response for the i-th observation; β₀ = intercept; β₁ = slope; Xᵢ = predictor value; εᵢ = random error (residual) for observation i.
LINEARITY ASSUMPTION
E(Yᵢ | Xᵢ) = β₀ + β₁Xᵢ
The conditional expectation of Y given X is a linear function of the parameters. Equivalently, E(εᵢ | Xᵢ) = 0 for all i. If the true relationship is curvilinear, this expectation is not zero and the linear model is misspecified.
INDEPENDENCE ASSUMPTION
Cov(εᵢ, εⱼ) = 0 for all i ≠ j
The covariance between any two distinct error terms is zero, meaning the error for one observation is unrelated to the error for any other observation. Violations commonly arise in longitudinal or spatially correlated data.
NORMALITY AND EQUAL VARIANCE
εᵢ ~ N(0, σ²) for all i
Each error term follows a normal distribution with mean zero and constant variance σ². The constant σ² across all observations encodes the homoscedasticity (equal variance) assumption. When σ² varies with X—i.e., Var(εᵢ | Xᵢ) = σᵢ²—standard errors from OLS are biased.

A compact way to express all four conditions simultaneously is: ε ~ N(0, σ²I), where ε is the n × 1 vector of errors, 0 is a zero vector, and σ²I is a scalar variance times the identity matrix. The identity matrix enforces both equal variance (all diagonal elements are σ²) and independence (all off-diagonal elements are zero). This elegant formulation makes it clear that a single violation—say, correlated errors—changes the covariance matrix from σ²I to some other structure Σ, invalidating the standard OLS inference formulas.

Detailed Diagnostic Methods for Each Assumption

Each of the four LINE assumptions has both graphical and formal testing procedures. In practice, graphical methods are preferred as the primary diagnostic because formal tests can be overly sensitive in large samples (rejecting trivial violations) or underpowered in small samples (failing to detect meaningful violations). The diagram below presents a decision flowchart for the complete assumption-checking process.

A complete assumption-checking flowchart. After fitting the model and computing residuals, each of the four LINE assumptions is assessed through both graphical tools and formal hypothesis tests. When violations are detected, remedial strategies (transformations, robust methods, or alternative models) should be applied before interpreting coefficients.
Summary of diagnostic tools for each LINE assumption
AssumptionPrimary Graphical DiagnosticFormal TestWhat to Look For
LinearityResidual vs. fitted values plot; partial regression plotsRamsey RESET test; lack-of-fit F-testCurved or U-shaped pattern in residuals; systematic departure from zero line
IndependenceResiduals vs. time/order plot; autocorrelation function (ACF) plotDurbin–Watson test (d statistic); Ljung–Box testRuns of positive/negative residuals; sinusoidal pattern; d ≈ 2 indicates no autocorrelation
NormalityNormal Q–Q plot; histogram with normal curve overlayShapiro–Wilk test; Anderson–Darling test; Kolmogorov–Smirnov testPoints deviating from the 45° reference line on Q–Q plot; skewness or heavy tails in histogram
Equal VarianceScale-location plot (√|standardized residuals| vs. fitted); residual vs. fitted for fan shapeBreusch–Pagan test; White's test; Levene's test (for grouped data)Increasing or decreasing spread in residuals; megaphone/fan pattern; significant BP test p-value

Worked Example — Blood Pressure and Age

A biostatistician fits a simple linear regression predicting systolic blood pressure (SBP, in mmHg) from age (in years) using data from n = 50 adults in a cross-sectional study. The fitted model is SBP = 98.7 + 0.97 × Age. Before interpreting the slope coefficient, the analyst must verify all four LINE assumptions. We walk through each check using the model's residuals.

Checking LINE Assumptions for the SBP–Age Model
1
Step 1 — Compute ResidualsFor each of the 50 observations, compute êi = SBPi − (98.7 + 0.97 × Agei). For example, if patient 1 is 45 years old with SBP = 145 mmHg, then ŷ₁ = 98.7 + 0.97(45) = 142.35, so ê₁ = 145 − 142.35 = 2.65.
ê₁ = 2.65 mmHg
2
Step 2 — Check LinearityPlot all 50 residuals against the fitted values. In this example, the scatter appears randomly distributed around zero with no systematic curvature. We confirm this impression with the Ramsey RESET test: the test statistic is F = 1.42 with p = 0.24, so we fail to reject the null hypothesis of correct specification.
✓ Linearity assumption satisfied (RESET p = 0.24 > 0.05)
3
Step 3 — Check IndependenceSince this is a cross-sectional study (not time-series), observations were sampled independently from different individuals. We verify that no clustering structure exists (e.g., participants from the same family or clinic). The Durbin–Watson statistic is d = 1.89, which is close to 2 and falls within the non-rejection bounds.
✓ Independence satisfied (cross-sectional design, DW = 1.89 ≈ 2)
4
Step 4 — Check NormalityConstruct a normal Q–Q plot of the standardized residuals. The points fall closely along the 45° reference line with minor deviations in the tails. The Shapiro–Wilk test yields W = 0.976, p = 0.41. With p well above 0.05, we have no evidence to reject normality. A histogram of the residuals is approximately bell-shaped and centered at zero.
✓ Normality satisfied (Shapiro–Wilk p = 0.41)
5
Step 5 — Check Equal VarianceExamine the residual-versus-fitted plot for a fanning or trumpet pattern. In this case, we notice that the residual spread appears slightly wider for older patients (higher fitted values). The Breusch–Pagan test gives χ² = 5.83, p = 0.016, suggesting statistically significant heteroscedasticity. This is the one assumption that appears violated.
✗ Equal variance violated (Breusch–Pagan p = 0.016 < 0.05)
6
Step 6 — RemediationBecause heteroscedasticity is detected, the analyst has several options: (a) use heteroscedasticity-consistent (HC) standard errors (also called robust or sandwich standard errors) to obtain valid inference without changing the model; (b) apply a variance-stabilizing transformation such as log(SBP); or (c) use weighted least squares (WLS) if the variance function can be modeled. In this example, using HC standard errors increases the standard error of β̂₁ from 0.18 to 0.23, widening the 95% CI from (0.61, 1.33) to (0.51, 1.43). The coefficient remains statistically significant, but the confidence interval more honestly reflects the uncertainty.
Corrected 95% CI for slope: (0.51, 1.43) using robust SE

Consequences of Violations & Remedial Strategies

Not all assumption violations are equally damaging. Understanding the specific consequences of each violation helps researchers prioritize diagnostics and select appropriate remedial measures. The table below summarizes what goes wrong when each assumption fails and the most common corrective strategies used in biostatistical practice.

Consequences and remedies for each LINE assumption violation
Violated AssumptionConsequenceRemedial Strategy
LinearityBiased coefficient estimates; predicted values systematically too high or too low in certain regions; R² underestimates explanatory powerAdd polynomial terms (X², X³); apply splines; transform X or Y (e.g., log, square root); use generalized additive models (GAMs)
IndependenceStandard errors are underestimated (positive autocorrelation) or overestimated; inflated Type I error rates; confidence intervals are too narrowUse mixed-effects models for clustered data; employ GEE (generalized estimating equations); fit time-series models (ARIMA) for temporal data; include random effects
NormalityHypothesis tests and confidence intervals become inaccurate, especially in small samples; prediction intervals are unreliable; coefficient estimates remain unbiasedApply Box–Cox or log transformation to Y; use bootstrapped confidence intervals; rely on CLT for large samples (n > 30–50); use nonparametric regression
Equal VarianceOLS is no longer efficient; standard errors are biased (can be inflated or deflated); confidence intervals have incorrect coverage probabilityUse robust (sandwich/HC) standard errors; weighted least squares (WLS); variance-stabilizing transformations (log, sqrt); model the variance function explicitly
KEY TAKEAWAY
A useful hierarchy for prioritizing assumption checks is: linearity first (because a misspecified functional form makes everything else meaningless), then independence (because correlated errors can dramatically distort inference), then equal variance (because it affects efficiency and standard errors), and finally normality (because it is least consequential in large samples thanks to the Central Limit Theorem). Think of it like building a house: linearity is the foundation, independence is the framing, equal variance is the insulation, and normality is the paint—you can tolerate imperfect paint far more than a cracked foundation.

Connection to Advanced Theory — Beyond OLS

When one or more LINE assumptions are substantially violated and simple remedial measures are insufficient, biostatisticians turn to more sophisticated modeling frameworks. These advanced methods relax specific assumptions while preserving valid inference. Understanding these extensions positions you to select the right tool for complex biomedical data structures where standard OLS falls short.

OLS versus advanced regression alternatives
FeatureStandard OLS RegressionAdvanced Alternatives
Error distributionAssumes normal (Gaussian) errorsGLMs allow binomial, Poisson, gamma, and other distributions via a link function
Functional formLinear in parameters; polynomial terms added manuallyGAMs fit smooth nonparametric functions; spline regression captures flexible curves
Correlated errorsAssumes independent errors (Cov = 0)Mixed models and GEE handle clustering, repeated measures, and hierarchical data
HeteroscedasticityAssumes constant variance σ²WLS weights inversely by variance; robust SE provides valid inference without reweighting
Outlier sensitivityHighly sensitive; single outlier can shift regression lineRobust regression (M-estimation, LTS) downweights influential points automatically

In modern biostatistical practice, the assumption-checking workflow is not merely a pass/fail gate but a diagnostic process that guides model selection. A researcher who discovers non-normality and heteroscedasticity in residuals from a model of hospital costs, for example, might switch to a generalized linear model (GLM) with a gamma family and log link, which simultaneously addresses both violations by modeling the conditional mean on a log scale with a variance proportional to the mean. Similarly, researchers analyzing clinical trial data with repeated measures on each patient should recognize the independence violation and adopt a linear mixed-effects model from the outset, rather than attempting OLS and retrospectively diagnosing correlated residuals.

Practice Problems

PROBLEM 1CONCEPTUAL
A colleague tells you, "I ran a regression and the R² is 0.85, so the model is definitely valid." Explain why a high R² does not guarantee that the regression assumptions are met. Which specific assumption violations could produce a misleadingly high R²?
PROBLEM 2BASIC CALCULATION
A Durbin–Watson test on a time-series regression with n = 30 observations and k = 2 predictors yields d = 0.95. Using the critical values dL = 1.28 and dU = 1.57 at α = 0.05, what do you conclude about the independence assumption?
PROBLEM 3INTERMEDIATE
A researcher regresses BMI on daily caloric intake for n = 200 adults. The residual-versus-fitted plot shows a clear funnel (fan) shape—residuals are more spread out at higher fitted values. The Breusch–Pagan test gives χ² = 12.4, p = 0.0004. (a) Which assumption is violated and why? (b) The researcher proposes taking the log of caloric intake as a fix. Is this the most direct remedy? Suggest an alternative approach and explain when each is preferable.
PROBLEM 4APPLIED
An epidemiologist studies the relationship between PM₂.₅ air pollution exposure (μg/m³) and forced expiratory volume (FEV₁, in liters) across 15 monitoring sites, with multiple patients measured at each site. She fits a simple OLS regression of FEV₁ on PM₂.₅. The residual-versus-fitted plot looks fine, and the Q–Q plot is approximately linear. However, a colleague points out that patients within the same monitoring site share unmeasured environmental factors. (a) Which LINE assumption is most likely violated, and why? (b) What modeling approach would you recommend?
PROBLEM 5CRITICAL THINKING
Consider two scenarios: (A) A Shapiro–Wilk test on residuals from a regression with n = 25 yields p = 0.04. (B) The same test on residuals from a regression with n = 5,000 yields p = 0.001, but the Q–Q plot shows only trivial deviation from normality. In each case, discuss whether you would be concerned about the normality assumption and what action, if any, you would take. How does sample size affect your interpretation of formal normality tests versus graphical diagnostics?

Lesson Summary

The validity of ordinary least squares regression rests on four foundational conditions known as the LINE assumptions: linearity (the true relationship between predictors and outcome is linear in the parameters), independence (residuals are uncorrelated with one another), normality (residuals follow a Gaussian distribution), and equal variance (residual variance is constant across all levels of the predictor). These conditions are assessed primarily through residual diagnostic plots—residual-versus-fitted plots for linearity and homoscedasticity, Q–Q plots for normality, and time-order plots or study design review for independence—supplemented by formal tests such as the Breusch–Pagan, Durbin–Watson, and Shapiro–Wilk tests.

When violations are detected, remedial strategies include variable transformations (log, square root, Box–Cox) for non-linearity and non-normality, robust standard errors or weighted least squares for heteroscedasticity, and mixed-effects models or generalized estimating equations for correlated observations. Remember that graphical diagnostics are generally more informative than formal tests, especially in very large or very small samples, and that assumption checking should be viewed as a routine, non-negotiable step in every regression analysis—not an afterthought.

Varsity Tutors • Biostatistics • Checking Regression Assumptions