Connect the ideas
A model expresses a conditional relationship. Its outcome scale, link, dependence structure and uncertainty need to match the question.
Continuous outcomes, binary responses, ordered categories and counts call for different models. Residuals compare observations with model expectations. Diagnostics can expose a mismatch; they cannot establish every design assumption.
Specify the outcome, predictors, interactions and clustering. Inspect residual behavior, influential observations and the range over which the model is used.
A mathematical connection: Multiple linear regression model
beta_j the slope of Y per one-unit change in X_j, holding other predictors fixed; epsilon the residual.
Read the formula in context: Linear regressionA coefficient is conditional on the model and included variables. Adjustment does not by itself remove confounding; extrapolation can be especially fragile.
Further reading: CMU · Models, diagnostics and scientific reports · An Introduction to Statistical Learning.
Before you begin
What you will learn
- Distinguish observed responses, fitted values and residuals.
- Use assumptions and diagnostics to qualify model-based claims.
- Separate training fit, future prediction and causal interpretation.
A fitted line is a starting point
For a simple fitted linear relationship, is the model's fitted value for row . The residual compares that fitted value with the observed response. It is not the same as an unobserved population error or a future prediction error.
A coefficient describes a relationship under the model and its conditioning choices. It does not become a causal effect merely because other predictors were included. Examine the design, functional form, residual patterns and influential observations before trusting an interpretation.
A model can fit training observations well and perform poorly on new cases. Validation should reflect the intended use and preserve relevant grouping or time order. A confidence interval for a modeled mean and a prediction interval for an individual response answer different questions.
Worked reasoning / Original illustration
Fit for which task?
A team fits a model to historical service times and wants to use it for next month’s staffing.
- Check whether the historical observations represent the future setting and whether there are time or group dependencies.
- Inspect residual behavior, extrapolation and influential cases rather than only a fit score.
- Evaluate predictions on appropriately separated data, using a performance measure that matches the staffing decision.
The intended prediction setting determines what a useful evaluation must preserve.
Read the ideas in sequence
Follow these readings, then return for the reasoning check below.
- 5.1Linear regression
Linear regression fits a straight-line relationship between a continuous outcome and one or more predictors, reporting each predictor's coefficient with a significance test, an overall model fit (R-squared), and a full set of assumption diagnostics.
- 5.2Linearity
Linearity is the assumption that the outcome changes by a constant amount per unit of a predictor (OLS) or by a constant amount on the log-odds scale (logistic regression), rather than curving.
- 5.3Residual
A residual is the difference between an observed value and the value the model predicted for it: residual = observed minus fitted.
- 5.4Prediction interval
A 95% prediction interval is a range built so that, in repeated use, 95% of such intervals contain a single new observation at the given predictor values; it is wider than the confidence interval for the mean because it covers the scatter of individual values as well as the uncertainty in the fitted line.
- 5.5Overfitting
Overfitting is when a model learns the noise and idiosyncrasies of its training data so closely that it fits new, unseen data noticeably worse than it fit the data it was trained on.
- 5.6Cross-validation
Cross-validation estimates how well a model will perform on new data by repeatedly holding out part of the data for testing while fitting on the rest, and averaging performance over the held-out parts.
Pause and reason
Check your understanding
Adding predictors improves a model’s training fit. Has its performance on future cases necessarily improved?
Show explanation
No. Extra flexibility can capture noise in the training data. Compare appropriate validation performance and inspect the model’s assumptions and intended use. A training-fit improvement alone does not establish better generalization.
Take it with you
Keep the observation, fitted value, residual, inference and future prediction in their separate roles.
Begin this chapter's readings →Further university reading
- Penn State STAT 501: Simple Linear Regression
- An Introduction to Statistical Learning: Author resources
The chapter bridges and reasoning checks are original KernelStats material. These sources offer further study; they have not reviewed or endorsed this book. Read about sources and review limits.
