SECTION 1
Historical Context & Motivation
Statistical modeling has always faced a fundamental tension: a model must be complex enough to capture genuine patterns in data, yet simple enough to generalize beyond the observations used to build it. In the biomedical sciences, where researchers routinely fit regression models to predict clinical outcomes—disease risk, drug response, patient survival—getting this balance wrong can have serious consequences. An overfitted model that memorizes quirks of one patient cohort may fail catastrophically when applied to a new population, producing misleading predictions that erode clinical trust.
The intellectual roots of model selection stretch back to debates about scientific parsimony that predate modern statistics. The philosophical principle known as Occam's razor—entities should not be multiplied beyond necessity—guided early scientists to prefer simpler explanations. As regression methods matured through the twentieth century, statisticians translated this intuition into formal criteria that could quantify the trade-off between model fit and model complexity. These criteria remain central to biostatistical practice today.
1805 • Least Squares Introduced
1929 • Fisher & Degrees of Freedom
1973 • Akaike Information Criterion (AIC)
1978 • Schwarz / Bayesian Information Criterion (BIC)
1995 • Cross-Validation in Biostatistics
The central question that this lesson addresses is deceptively simple: given a set of candidate models for a biomedical outcome, how do we choose the one that will perform best on future, unseen data? Answering this question requires understanding what overfitting is, why it arises, and what tools—information criteria, cross-validation, regularization—exist to guard against it.
SECTION 2
Core Principles & Definitions
Before diving into formal criteria, it is essential to establish the conceptual vocabulary that underpins the entire model-selection enterprise. Every dataset contains two components: a systematic signal (the true relationship between predictors and outcome) and random noise (measurement error, biological variability, unmeasured confounders). A model's task is to capture as much signal as possible while ignoring noise. When a model begins fitting noise, it is said to overfit the training data.
Bias
Variance
Bias–Variance Trade-off
Training vs. Test Error
Parsimony
KEY TAKEAWAY
SECTION 3
The Bias–Variance Trade-off Visualized
The most iconic visualization in model selection is the U-shaped curve that plots prediction error against model complexity. As complexity increases from left to right, training error falls monotonically—the model simply gets better at fitting the data it has already seen. However, test error follows a U shape: it first drops (as the model captures real signal) and then climbs (as the model begins chasing noise). The optimal model complexity lies at the minimum of the test-error curve.
Notice how the gap between training error and test error widens dramatically in the overfitting region on the right side of the diagram. This gap is itself a diagnostic: if a model performs extremely well on training data but poorly on held-out data, overfitting is almost certainly at play. In biostatistics, where sample sizes are often modest relative to the number of candidate predictors (genomic covariates, imaging features, laboratory assays), this gap can appear earlier and more sharply than in data-rich domains.
SECTION 4
Mathematical Framework
The bias–variance decomposition provides the theoretical backbone for understanding overfitting. Consider a regression setting where we wish to predict an outcome Y from predictors X. Suppose the true data-generating process is Y = f(X) + ε, where ε is irreducible noise with E[ε] = 0 and Var(ε) = σ². For an estimated model f̂(X) trained on a particular sample, the expected prediction error (EPE) at a point x₀ can be decomposed as follows.
BIAS–VARIANCE DECOMPOSITION
Where Bias(f̂(x₀)) = E[f̂(x₀)] − f(x₀), measuring systematic error; Var(f̂(x₀)) captures the variability of f̂ across different training samples; and σ² is the irreducible error that no model can eliminate.
Two widely used information criteria translate this decomposition into practical tools for model comparison. Both start with the model's maximized log-likelihood and add a penalty proportional to the number of estimated parameters.
AKAIKE INFORMATION CRITERION (AIC)
Where L̂ is the maximized likelihood of the model and k is the number of estimated parameters. Lower AIC indicates a better model. The 2k penalty discourages unnecessary parameters.
BAYESIAN INFORMATION CRITERION (BIC)
Where n is the sample size. Because ln(n) > 2 for n ≥ 8, BIC penalizes complexity more heavily than AIC, favoring simpler models, especially in large samples.
ADJUSTED R-SQUARED
A modification of R² that penalizes the addition of predictors that do not improve the model sufficiently. Unlike ordinary R², R²_adj can decrease when a newly added predictor contributes more noise than signal.
Why Penalize Complexity?
SECTION 5
Model Validation Strategies
Information criteria provide a quick, computation-free approximation to out-of-sample performance, but cross-validation offers a more direct estimate by actually evaluating models on data that were not used for fitting. In biostatistics, cross-validation has become a gold-standard tool for assessing predictive accuracy, especially when the goal is to deploy a model in clinical practice.
Several variants of cross-validation exist. Leave-one-out cross-validation (LOOCV) sets K = n, using each observation as its own test set. This gives a nearly unbiased estimate of prediction error but is computationally expensive and can have high variance. In practice, 5- or 10-fold CV provides a good compromise. For time-to-event outcomes common in clinical research (e.g., survival analysis), specialized methods such as optimism-corrected bootstrap validation are often preferred because they account for the censoring structure of the data. The key principle underlying all these techniques is the same: never evaluate a model solely on the data used to train it.
| Validation Method | Approach | Pros | Cons |
|---|---|---|---|
| Train/Test Split | Hold out a fixed fraction (e.g., 30%) as a test set | Simple, fast, easy to implement | High variance; result depends on the particular split |
| K-Fold CV | Rotate test fold through K partitions of data | Lower variance than single split; efficient use of data | K models must be fitted; slight bias for small K |
| LOOCV | Each observation is its own test set (K = n) | Nearly unbiased error estimate | Very high computational cost; high estimate variance |
| Bootstrap | Resample with replacement; evaluate on out-of-bag cases | Low variance; handles complex sampling designs | Can be optimistically biased without correction (e.g., 0.632+ method) |
Comparison of common model validation strategies
SECTION 6
Worked Example: Selecting a Logistic Regression Model
Suppose a biostatistician has collected data on n = 200 patients with a binary outcome (disease present vs. absent). Three candidate logistic regression models are under consideration, each with different sets of predictors. We will compare them using AIC and BIC to illustrate the model-selection process.
Comparing Three Candidate Models with AIC and BIC
- 1
Step 1 — Define the Candidate Models
Model A (simple): 2 predictors (age, BMI) → k = 3 parameters (2 slopes + intercept). Model B (moderate): 5 predictors (age, BMI, blood pressure, cholesterol, smoking status) → k = 6. Model C (complex): 12 predictors (including interaction terms and polynomial terms) → k = 13. - 2
Step 2 — Obtain Maximized Log-Likelihoods
After fitting each model via maximum likelihood estimation, we obtain: ln(L̂A) = −118.5, ln(L̂B) = −105.2, ln(L̂C) = −100.8. As expected, the more complex model achieves a higher (less negative) log-likelihood because it fits the training data more closely. - 3
Step 3 — Compute AIC for Each Model
Using AIC = −2 × ln(L̂) + 2k: AICA = −2(−118.5) + 2(3) = 237.0 + 6.0 = 243.0. AICB = −2(−105.2) + 2(6) = 210.4 + 12.0 = 222.4. AICC = −2(−100.8) + 2(13) = 201.6 + 26.0 = 227.6.By AIC, Model B is preferred (AIC = 222.4, lowest). - 4
Step 4 — Compute BIC for Each Model
Using BIC = −2 × ln(L̂) + k × ln(n), with ln(200) ≈ 5.30: BICA = 237.0 + 3(5.30) = 237.0 + 15.9 = 252.9. BICB = 210.4 + 6(5.30) = 210.4 + 31.8 = 242.2. BICC = 201.6 + 13(5.30) = 201.6 + 68.9 = 270.5.By BIC, Model B is again preferred (BIC = 242.2). Note how BIC penalizes Model C much more severely than AIC does. - 5
Step 5 — Interpret the Results
Both AIC and BIC agree that Model B strikes the best balance between goodness of fit and complexity. Model C achieves a slightly better fit (lower −2 ln L̂) but its 13 parameters are not sufficiently justified by the improvement. With only 200 observations, Model C's 13 parameters approach the guideline limit of n/15 ≈ 13.3, raising concerns about overfitting. Model B, with 6 parameters, is well within safe bounds.Select Model B with 5 predictors as the final model.
SECTION 7
Comparing Model-Selection Criteria
No single model-selection criterion is universally optimal; each embeds different assumptions about the goal of modeling. Understanding the strengths and weaknesses of each approach helps biostatisticians choose the right tool for a given research question.
| Criterion | Philosophical Basis | Penalty Strength | Best For | Limitation |
|---|---|---|---|---|
| AIC | Kullback–Leibler divergence minimization; asymptotically equivalent to LOOCV | Moderate (2k) | Prediction-focused modeling | May select overly complex models in small samples |
| BIC | Bayesian model posterior probability; consistent estimator of true model | Strong (k × ln n) | Identifying the 'true' model structure | Assumes the true model is in the candidate set |
| Adjusted R² | Penalized proportion of variance explained | Mild | Quick comparisons of linear regression models | Not applicable to logistic regression or survival models |
| Cross-Validation | Direct estimation of out-of-sample prediction error | Implicit (data-driven) | Any predictive modeling context; non-parametric models | Computationally expensive; results vary with fold assignment |
Comparison of major model-selection criteria
KEY TAKEAWAY
SECTION 8
Connection to Regularization & Advanced Methods
The model-selection criteria discussed so far operate by choosing among a discrete set of candidate models. An alternative paradigm—regularization—addresses overfitting from within the estimation procedure itself. Instead of selecting or dropping predictors outright, regularized methods impose a continuous penalty on the magnitude of regression coefficients, shrinking them toward zero. This approach is particularly powerful in high-dimensional biomedical settings (e.g., genomics, proteomics) where the number of candidate predictors p may rival or exceed the sample size n.
| Feature | Traditional Model Selection (AIC/BIC) | Regularization (Ridge, LASSO) |
|---|---|---|
| How complexity is controlled | Compare discrete candidate models; select the one with best criterion value | Penalize large coefficients continuously via a tuning parameter λ |
| Variable selection | Explicit: predictors are included or excluded | LASSO can shrink coefficients exactly to zero; Ridge shrinks but retains all |
| High-dimensional data (p >> n) | Difficult; requires pre-screening or stepwise methods | Naturally handles p >> n through shrinkage |
| Tuning | No tuning parameter; penalty is built into the criterion formula | λ is typically selected via cross-validation |
| Interpretability | Straightforward: selected model coefficients are ordinary estimates | Coefficients are biased toward zero; inference requires special methods |
Traditional model selection vs. regularization approaches
In more advanced courses, you will encounter Ridge regression (L2 penalty) and LASSO (L1 penalty), as well as the elastic net (a blend of both). These methods seamlessly integrate model selection and estimation into a single step and have become indispensable tools in modern biostatistical practice, especially for building prediction models from electronic health records, imaging data, and multi-omics platforms. The concepts introduced in this lesson—bias–variance trade-off, the danger of evaluating on training data, and the need for out-of-sample validation—remain the conceptual foundation upon which all these advanced techniques are built.
SECTION 9
Practice Problems
Question 1: CONCEPTUAL
Show answer
Question 2: BASIC CALCULATION
Show answer
Question 3: INTERMEDIATE
Show answer
Question 4: APPLIED
Show answer
Question 5: CRITICAL THINKING
Show answer
SUMMARY
Lesson Summary
Summary
Model selection in biostatistics addresses the fundamental tension between fitting data well and generalizing to new observations. The bias–variance trade-off frames this challenge mathematically: simple models suffer from high bias (underfitting), while overly complex models exhibit high variance (overfitting). The hallmark diagnostic of overfitting is a large gap between training error and test error. Information criteria such as AIC and BIC quantify this trade-off by penalizing model complexity, with BIC applying a stronger penalty that scales with sample size.
Cross-validation provides a direct, data-driven estimate of out-of-sample performance by rotating training and test partitions across the data. The events-per-variable guideline (10–15 events per predictor) offers a practical safeguard against overfitting in clinical prediction models. Looking ahead, regularization methods like LASSO and Ridge regression extend these ideas by embedding complexity control directly within the estimation process, enabling principled modeling even in high-dimensional settings. Mastering these foundational concepts equips you to build biostatistical models that are not only accurate on today's data but robust enough to guide clinical decisions for future patients.