What Is Linear Regression? Read Results Through Slopes and Residuals
Linear regression estimates an average relationship between an outcome and one or more predictors using a form that is linear in its coefficients. A slope describes how much the model-estimated mean outcome changes for a one-unit change in a predictor. To interpret the result well, examine residuals and the error structure as well as coefficients, and do not turn an association into a causal claim.
Linear regression estimates an average relationship between an outcome and one or more predictors using a form that is linear in its coefficients. A slope describes how much the model-estimated mean outcome changes for a one-unit change in a predictor. To interpret the result well, examine residuals and the error structure as well as coefficients, and do not turn an association into a causal claim.
What does “linear” mean here?
A simple model with one predictor is:
Y = β₀ + β₁X + ε
Y is the outcome, X the predictor, β₀ the intercept, β₁ the slope, and ε the part the model does not explain. Ordinary least squares (OLS) chooses the intercept and slope to minimize the sum of squared residuals, where a residual is an observed value minus its fitted value. Squaring means that large residuals can have disproportionate influence.
“Linear” does not require a straight relationship between X and Y. It means linear in the coefficients. For example, Y = β₀ + β₁X + β₂X² + ε is curved as a function of X but linear in β₀, β₁, and β₂, so it can be fitted by linear least squares. The NIST statistical handbook describes models linear in their coefficients, including models with transformed predictors or polynomial terms.
What units do the coefficients use?
The slope β₁ is the difference in the model-estimated mean outcome for a one-unit increase in X. If X is study time in hours and Y is a test score in points, the slope is measured in points per hour. It does not mean every individual gains that many points, nor that increasing study time causes a score increase.
The intercept β₀ is the model mean when X = 0. If zero is outside the observed range or has no practical meaning, the intercept may be a mathematical reference point without a useful substantive interpretation. In a model with several predictors, each slope describes a conditional relationship with the other included predictors held fixed; interpretation also depends on measurement scales, coding, and included terms.
Hypothetical example: how do we calculate a slope from four observations?
The following data are a hypothetical example for demonstrating the calculation, not results from real students or research.
| Study hours X | Score Y | Fitted value | Residual (observed − fitted) |
|---|---|---|---|
| 1 | 52 | 51.3 | 0.7 |
| 2 | 55 | 55.1 | −0.1 |
| 3 | 57 | 58.9 | −1.9 |
| 4 | 64 | 62.7 | 1.3 |
The OLS line for these four points is: predicted score = 47.5 + 3.8 × study hours. The slope is 3.8 points per hour and the intercept is 47.5 points. Fitted values need not equal observations. At three hours, for example, the model predicts 58.9 points; the residual is −1.9 because the observed score is 57. For an OLS line with an intercept, the four residuals sum to zero apart from rounding.
Substituting five hours gives a prediction of 66.5, but the observed data cover only one to four hours. This is extrapolation beyond the data range. Before relying on it, ask whether evidence supports a straight relationship in that region. This example explains the arithmetic; four observations do not establish the strength of a relationship or its ability to generalize.
What can residuals tell us?
A residual is observed outcome minus fitted outcome. Plot residuals against fitted values or predictors and check whether they scatter around zero without a systematic shape. NIST recommends residual plots against predictors as a primary way to assess whether the model’s functional form is adequate. A pattern may point to a need to improve the form or examine omitted variables.
Curvature: A straight term may miss a bend. A quadratic term, transformation, or piecewise form may help, but justify it with the subject matter and data, then validate it again.
Changing spread, such as a funnel: Error variance may change with outcome level. This can affect standard errors, confidence intervals, and tests even when the coefficient calculation is possible. Consider whether a transformation, weighted least squares, or robust inference fits the goal.
Patterns by time or collection order: Errors may not be independent. Account for trends, seasonality, or repeated observations within people or groups.
One or two unusual points: Check whether they are input errors or genuine rare cases. OLS can be sensitive to outliers, so do not remove them without justification; examine and document how results change with and without them.
A residual pattern does not prove its cause. A single R² value does not prove that the model is correct either. NIST advises using residual plots while recognizing that no single plot can fully establish model adequacy.
Which assumptions matter for inference?
Key checks for classical linear regression include whether the mean outcome has the specified form in the predictors, whether the error mean is zero conditional on the predictors, whether error variance is constant, and whether errors across observations are independent. For small samples, an approximately normal error distribution can matter for exact interpretations of usual t tests and confidence intervals. Normality is not a requirement on the predictors themselves. The meaning of independence also depends on sampling and on repeated or clustered data.
If an assumption fails, least-squares computation does not automatically become impossible, but standard errors, tests, and intervals may no longer be reliable as stated. Depending on the cause and purpose, change model terms or use methods that account for variance, clusters, or time dependence, then revisit residuals and validation performance.
How are explanatory intervals different from prediction intervals?
A slope estimate varies across samples, so it is usually reported with an uncertainty interval. A confidence interval for the mean response describes uncertainty when estimating the group mean at a given X. A prediction interval for a new observation estimates where a new person’s or case’s outcome may fall under that condition. It includes both uncertainty in the estimated mean and individual residual variation, so it is usually wider. The R documentation for predict.lm() distinguishes confidence intervals for the mean from prediction intervals for future observations.
Intervals depend on the model and sampling design being appropriate. Sample size alone does not guarantee quality, and uncertainty may grow near the edge of or beyond the observed predictor range. Report what is being estimated (a mean or a new case), the units, interval type, and applicable range rather than presenting a bare point estimate.
How can you fit and validate a model in practice?
Define the question and units. State what you want to explain or predict, what one row represents, and the measurement units of the outcome and predictors.
Check plots and data quality. Assess whether a linear form is a reasonable starting point and check missing values, unusual observations, and category coding. Preserve time order and repeated-measure structure.
Fit an interpretable baseline model. Specify the terms, analysis sample, and missing-data handling used by OLS. R’s `lm()` fits linear models; its default includes an intercept, and missing-data handling depends on the selected option.
Review coefficients and residuals. Interpret units, reference points, conditions holding other variables fixed, and uncertainty—not just the sign. Compare residuals with fitted values, each predictor, and time order.
Validate for the goal. For explanation, focus on assumptions and coefficient stability. For prediction of new cases, evaluate errors on data kept separate from training; for future forecasts, preserve time order. Performance outside the observed range cannot be verified from these data alone.
Report reproducibly. Record the analysis sample, formula and coefficient units, uncertainty intervals, diagnostics, validation method, missing-data handling, exclusion rules, and limitations.
How can you avoid common misinterpretations?
Calling association causation: A slope describes a relationship in the observed data under the specified model. Claiming that more study time causes higher scores requires additional evidence about design, time order, and confounding. See [Correlation and causation](https://knowledge.linkspot.net/ko/articles/febf400f-cb9f-407a-a11b-eb4dc65c1589).
Assuming a high R² means the model is right: R² summarizes variation explained under the chosen data and definition. It does not establish that a straight form is adequate, that predictions will work on external data, or that the relationship is causal.
Extending a line beyond the observed range: A plausible line within the observed range is not guaranteed to continue far outside it. NIST notes the limited curve forms available to linear least squares and the risk of extrapolation.
Automatically deleting unusual points: Removing a value just because it looks odd can erase meaningful variation in the population. Document whether it is a data error, the purpose of the analysis, and sensitivity results.
Ignoring “one unit”: If hours are converted to minutes, the numerical slope changes. Interpret predictions and conclusions together with units, coding, and model terms.
The key to linear regression is not a slope by itself, but what it summarizes about an outcome, units, conditional comparisons, and error structure. Start with plots, interpret coefficients on their original scale, inspect residuals and uncertainty intervals, and report the prediction range and causal limits. For choosing among models for different outcome types, see the regression analysis overview.
References
NIST/SEMATECH e-Handbook: Linear Least Squares Regression
NIST/SEMATECH e-Handbook: Check of assumptions
NIST/SEMATECH e-Handbook: Assess sufficiency of the functional part of the model
R documentation: Fitting Linear Models (lm)
R documentation: Prediction intervals for linear models (predict.lm)