College Statistics • Regression and Correlation

R² & Model Fit — Coefficient of Determination (R^2) and Model Fit

Quantifying how well a regression model explains the variability in observed data.

College Statistics subject emblem with a scatter plot, summation notation, and frequency columns.
Inside this lesson 10 sections 5 questions 9 figures

SECTION 1

Historical Context & Motivation

The quest to measure how well a mathematical model captures patterns in data stretches back to the origins of modern statistics. When researchers fit a regression line to observed data, they immediately face a natural question: how much of the variation in the response variable does this model actually explain? The coefficient of determination, denoted R², emerged as the standard answer to this question, providing a single number between 0 and 1 that summarizes a model's explanatory power. Its development is intertwined with the history of regression analysis itself and the broader effort to bring quantitative rigor to scientific inquiry.

1805 • Legendre's Method of Least Squares

Adrien-Marie Legendre published the method of least squares, establishing the mathematical foundation for fitting lines to data by minimizing squared residuals — the very sums from which R² is constructed.

1886 • Galton Coins 'Regression'

Francis Galton introduced the term regression toward mediocrity while studying hereditary traits, laying the conceptual groundwork for regression analysis and the idea that predictions regress toward the mean.

1896 • Pearson's Correlation Coefficient

Karl Pearson formalized the product-moment correlation coefficient (r). Since R² is literally the square of r in simple linear regression, Pearson's work provided the direct mathematical ancestor of the coefficient of determination.

1921 • Wright's Path Analysis

Sewall Wright developed path analysis for genetics, using squared correlation coefficients to decompose causal influence — one of the earliest explicit uses of R² as a measure of explained variance in structured models.

1960s–70s • Adjusted R² and Modern Diagnostics

As multiple regression became standard practice, statisticians recognized that R² mechanically increases with additional predictors. The adjusted R² was introduced to penalize model complexity, and goodness-of-fit diagnostics became a cornerstone of applied statistics.

The central question that R² addresses remains as relevant today as it was in the nineteenth century: when we propose a model to describe how one variable relates to another, we need a principled way to evaluate whether that model does a good job or a poor one. Without R², we would be left staring at residual plots and sums of squares with no normalized benchmark for comparison. R² transforms the raw mechanics of least-squares fitting into an interpretable proportion — the fraction of total variability in the outcome that the model captures.

SECTION 2

Core Principles & Definitions

Understanding R² requires a solid grasp of how variability in a response variable can be decomposed into components attributable to the model and to random error. The concept rests on a partitioning identity from least-squares theory: total variation equals explained variation plus unexplained variation. Each of the core principles below contributes to a complete understanding of what R² measures, what it does not, and why it matters in practice.

1

Total Sum of Squares (SST)

SST measures the total variability in the observed response variable y around its mean ȳ. It is computed as Σ(yᵢ − ȳ)². SST serves as the baseline against which model performance is judged — it captures all variation regardless of source.
2

Regression Sum of Squares (SSR)

SSR captures the portion of variability explained by the model. It equals Σ(ŷᵢ − ȳ)², measuring how much the fitted values ŷᵢ deviate from the overall mean. A larger SSR relative to SST implies the model is doing a good job capturing systematic patterns.
3

Error Sum of Squares (SSE)

SSE quantifies the unexplained or residual variability — the part left over after the model has done its work. Computed as Σ(yᵢ − ŷᵢ)², it represents the discrepancy between observed and predicted values. Minimizing SSE is exactly what least-squares regression accomplishes.
4

The Partition Identity

In ordinary least-squares regression with an intercept, SST = SSR + SSE. This identity allows us to define R² = SSR / SST = 1 − SSE / SST. Because SSR and SSE are non-negative and sum to SST, R² is bounded between 0 and 1 in standard linear regression.
5

Interpretation as Proportion

R² represents the proportion of variance in y explained by the model. An R² of 0.85 means 85% of the variability in the response is accounted for by the predictor(s). The remaining 15% is attributed to factors not captured by the model or to inherent randomness.
✦

KEY TAKEAWAY

Think of R² like a signal-to-noise ratio in audio engineering. The total variability in your data is the full audio track — it contains both the signal (the systematic pattern your model captures) and noise (random fluctuations). R² tells you what fraction of that track is actual signal. An R² of 0.90 is like an audio file that is 90% clear music and 10% static; R² = 0.30 is like a recording where only 30% of what you hear is the intended signal and the rest is hiss and interference.

SECTION 3

Visual Explanation — Decomposing Variability

The best way to internalize R² is to see how a single data point's deviation from the mean gets split into an explained component and a residual component. The following diagram illustrates this decomposition on a scatter plot with a fitted regression line. For any observation, the vertical distance from that point to the mean line ȳ is the total deviation; the portion from ȳ to the regression line ŷ is the explained part (captured by SSR), and the remaining gap from the regression line to the actual data point is the residual (captured by SSE).

Decomposition of Variability: SST = SSR + SSEx (Predictor)y (Response)ȳ (mean)ŷ = b₀ + b₁xObserved yᵢTotalDeviation(yᵢ − ȳ)ŷᵢ on lineExplained(ŷᵢ − ȳ)Residual(yᵢ − ŷᵢ)R² = SSR / SST = 1 − SSE / SSTProportion of total variation explained by the regression model
For the highlighted observation (pink dot at x ≈ 430), the total deviation (yᵢ − ȳ) splits into an explained component (ŷᵢ − ȳ, the distance from the mean to the regression line) and a residual component (yᵢ − ŷᵢ, the gap from the regression line to the actual point). R² is the ratio of the sum of squared explained components to the sum of squared total deviations across all points.

When you sum these squared deviations across every observation in the dataset, you obtain the three fundamental sums of squares. The key geometric insight is that these components are orthogonal in the sense of the Pythagorean theorem applied to the least-squares solution space: the fitted values and the residuals are uncorrelated (a consequence of the normal equations), so their variances add up to give the total variance. This orthogonality is what guarantees that SST = SSR + SSE and, consequently, that R² is a well-defined proportion between 0 and 1.

SECTION 4

Mathematical Framework

The mathematical formulation of R² ties together the sums of squares from least-squares theory. We present the primary definition, an equivalent formulation, and the corrected version for multiple regression, along with the connection to the Pearson correlation coefficient in the simple linear case.

TOTAL SUM OF SQUARES

SST=Σi=1n(yi−yˉ)2SST = Σᵢ₌₁ⁿ (yᵢ − ȳ)²

where yᵢ is the i-th observed value, ȳ = (1/n) Σyᵢ is the sample mean of y, and n is the sample size. SST measures the total variability in the response.

COEFFICIENT OF DETERMINATION

R2=1−(SSE/SST)=SSR/SSTR² = 1 − (SSE / SST) = SSR / SST

where SSE = Σ(yᵢ − ŷᵢ)² is the error (residual) sum of squares and SSR = Σ(ŷᵢ − ȳ)² is the regression sum of squares. Since SST = SSR + SSE, both expressions are equivalent. R² = 0 means the model explains none of the variance; R² = 1 means perfect explanation.

CONNECTION TO PEARSON r (SIMPLE LINEAR REGRESSION)

R2=rxγ2R² = r²ₓᵧ

In simple linear regression with one predictor, R² is exactly the square of the Pearson correlation coefficient r between x and y. This relationship holds only for simple linear regression and does not generalize directly to multiple regression, where R² is instead the squared multiple correlation coefficient.

ADJUSTED R²

Ra2dj=1−[(1−R2)(n−1)/(n−p−1)]R²ₐdⱼ = 1 − [(1 − R²)(n − 1) / (n − p − 1)]

where n is the sample size and p is the number of predictors. Adjusted R² penalizes for model complexity: adding a predictor that contributes negligible explanatory power will cause R²ₐdⱼ to decrease even if R² increases slightly. This makes it a more reliable criterion for comparing models with different numbers of predictors.

ℹ

Derivation Note

The identity SST = SSR + SSE can be derived by expanding (yᵢ − ȳ) = (yᵢ − ŷᵢ) + (ŷᵢ − ȳ), squaring both sides, and summing over all observations. The cross term 2Σ(yᵢ − ŷᵢ)(ŷᵢ − ȳ) vanishes because the OLS normal equations guarantee that residuals are orthogonal to fitted values: Σeᵢŷᵢ = 0 and Σeᵢ = 0. This orthogonality is the algebraic foundation upon which the entire R² framework rests.

SECTION 5

Interpreting R² — Spectrum of Model Fit

A common temptation is to declare fixed thresholds — say, R² > 0.90 is 'excellent' and R² < 0.50 is 'poor' — but such blanket rules ignore the realities of different research domains. In controlled physics experiments, R² values above 0.99 are routine because the underlying phenomena are deterministic and measurement error is small. In the social sciences, behavioral data are influenced by myriad unmeasured factors, and an R² of 0.30 can represent a genuinely strong and publishable finding. The interpretation of R² must always be contextualized within the discipline and research question.

R² Spectrum Across Disciplines

Weak Fit Strong Fit
Behavioral (typical) (8%)Economics (typical) (45%)Physics (typical) (92%)
Comparing R² Values: Three Scatter PlotsR² = 0.15Weak fitR² = 0.60Moderate fitR² = 0.95Strong fitKey Observations●R² = 0.15: Points are widely scattered; the regression line captures very little of the pattern.●R² = 0.60: A clear trend is visible, but substantial scatter remains around the fitted line.●R² = 0.95: Points cluster tightly along the regression line; the model explains almost all variability.Note: R² alone does not validate a model. Always check residual plots for non-linearity and heteroscedasticity.
Three scatter plots illustrate how the spread of data around the regression line relates to R². As R² increases from 0.15 to 0.95, the residuals shrink and the data points adhere more closely to the fitted line. Note that even a moderate R² of 0.60 shows a clear trend, reminding us that a 'good' R² depends entirely on the domain.
R² RangeGeneral InterpretationTypical Domain
0.00 – 0.10Very weak; predictor has negligible explanatory powerStock returns, individual behavior prediction
0.10 – 0.30Weak to moderate; useful in high-noise settingsPsychology, sociology, political science
0.30 – 0.60Moderate; meaningful relationship but much unexplained varianceEconomics, education research, epidemiology
0.60 – 0.85Good; model captures most of the varianceEngineering process control, clinical trials
0.85 – 1.00Strong to near-perfect; typical in controlled experimentsPhysics, chemistry calibration, metrology

Domain-specific interpretation of R² values

SECTION 6

Worked Example — Computing R² from Data

Suppose a researcher collects data on hours studied (x) and exam score (y) for n = 5 students. The data are: (2, 55), (4, 65), (6, 72), (8, 84), (10, 91). The researcher has already computed the least-squares regression line as ŷ = 43.2 + 4.7x. We will compute R² step by step.

Computing R² for Study Hours vs. Exam Score

  1. 1

    Step 1 — Compute the Mean of y

    We first find ȳ = (55 + 65 + 72 + 84 + 91) / 5 = 367 / 5 = 73.4. This is the baseline prediction if we used no model at all — simply predicting the average exam score for every student.
    ȳ = 73.4
  2. 2

    Step 2 — Compute SST (Total Sum of Squares)

    SST = Σ(yᵢ − ȳ)² = (55 − 73.4)² + (65 − 73.4)² + (72 − 73.4)² + (84 − 73.4)² + (91 − 73.4)² = (−18.4)² + (−8.4)² + (−1.4)² + (10.6)² + (17.6)² = 338.56 + 70.56 + 1.96 + 112.36 + 309.76 = 833.20. This is the total variability in exam scores around the mean.
    SST = 833.20
  3. 3

    Step 3 — Compute Fitted Values ŷᵢ

    Using ŷ = 43.2 + 4.7x: ŷ₁ = 43.2 + 4.7(2) = 52.6; ŷ₂ = 43.2 + 4.7(4) = 62.0; ŷ₃ = 43.2 + 4.7(6) = 71.4; ŷ₄ = 43.2 + 4.7(8) = 80.8; ŷ₅ = 43.2 + 4.7(10) = 90.2. These are the values the regression model predicts for each student.
    ŷ = {52.6, 62.0, 71.4, 80.8, 90.2}
  4. 4

    Step 4 — Compute SSE (Error Sum of Squares)

    SSE = Σ(yᵢ − ŷᵢ)² = (55 − 52.6)² + (65 − 62.0)² + (72 − 71.4)² + (84 − 80.8)² + (91 − 90.2)² = (2.4)² + (3.0)² + (0.6)² + (3.2)² + (0.8)² = 5.76 + 9.00 + 0.36 + 10.24 + 0.64 = 26.00. This is the residual variability not captured by the regression model.
    SSE = 26.00
  5. 5

    Step 5 — Compute SSR and R²

    SSR = SST − SSE = 833.20 − 26.00 = 807.20. Therefore R² = SSR / SST = 807.20 / 833.20 ≈ 0.9688. Equivalently, R² = 1 − SSE / SST = 1 − 26.00 / 833.20 ≈ 0.9688. This means approximately 96.9% of the variability in exam scores is explained by hours studied in this simple linear regression model.
    R² ≈ 0.969
  6. 6

    Step 6 — Verify via Correlation

    As a check, we can compute the Pearson correlation r between x and y. Using the formula r = Σ(xᵢ − x̄)(yᵢ − ȳ) / √[Σ(xᵢ − x̄)² × Σ(yᵢ − ȳ)²], we obtain r ≈ 0.9843. Squaring this gives r² ≈ 0.9688, which matches our R² — confirming the identity R² = r² in simple linear regression.
    r ≈ 0.984, r² ≈ 0.969 ✓

SECTION 7

Strengths & Limitations of R²

R² is one of the most widely reported statistics in regression analysis, yet it is frequently misinterpreted and overemphasized. A clear understanding of both its strengths and its limitations is essential for responsible statistical practice.

StrengthsLimitations
Intuitive interpretation: proportion of variance explained is immediately meaningful to both statisticians and non-technical audiences.Never decreases when predictors are added to a model, even if those predictors are irrelevant. This can create an illusion of improvement in multiple regression.
Bounded between 0 and 1 (in OLS with intercept), providing a standardized scale for comparison within a given dataset.Does not indicate whether the correct model has been specified. A high R² can occur with a fundamentally misspecified model (e.g., fitting a line to quadratic data).
Directly connected to the F-test for overall model significance: F = (R² / p) / [(1 − R²) / (n − p − 1)].Says nothing about causation. A strong R² between two variables does not mean one causes the other.
Easy to compute and available in every statistical software package.Sensitive to the range of x-values. Restricting the range of the predictor deflates R²; expanding it inflates R². This makes cross-study comparisons unreliable.
In simple linear regression, R² = r², providing a direct bridge to correlation analysis.Does not detect outliers or influential points, which can drastically inflate or deflate R². Always pair with residual diagnostics.

Strengths vs. Limitations of R²

⚠️

KEY TAKEAWAY

R² is like a grade point average for your model — it gives a useful single-number summary, but it can mask important details. Just as a student with a 3.5 GPA might have straight B+ grades or might have a mix of A's and D's, a model with R² = 0.70 might fit the data uniformly well or might be excellent in some regions and terrible in others. Always examine residual plots alongside R² to diagnose model adequacy, just as you would look at individual course grades to understand a transcript.

SECTION 8

Connection to Advanced Model-Fit Metrics

While R² provides a solid foundation for evaluating model fit in ordinary least-squares regression, advanced coursework introduces a family of related metrics that address its shortcomings or extend its logic to more complex modeling frameworks. Understanding how R² relates to these alternatives prepares you for graduate-level statistics, machine learning, and applied research contexts where simple R² is insufficient.

MetricRelationship to R²Key Advantage
Adjusted R²Penalizes R² for the number of predictors using the formula R²ₐdⱼ = 1 − [(1 − R²)(n − 1)/(n − p − 1)]. Always ≤ R².Prevents overfitting by punishing unnecessary model complexity; can decrease when a useless predictor is added.
AIC / BICInformation criteria based on log-likelihood rather than variance ratios. Not directly proportional to R² but serve the same goal of model comparison.Applicable to non-OLS models (logistic regression, GLMs); provide a more principled trade-off between fit and parsimony.
RMSE (Root Mean Square Error)RMSE = √(SSE/n). While R² is a relative measure, RMSE is on the same scale as y, making it an absolute measure of prediction accuracy.Directly interpretable in the units of the response; essential for prediction intervals and forecasting.
Pseudo-R² (McFadden, Nagelkerke)Analogues of R² for models estimated by maximum likelihood (e.g., logistic regression) where traditional R² is not defined.Extends the 'proportion of variation explained' intuition to classification and count models.
Cross-Validated R²Computes R² on held-out test data rather than training data. Can be negative if the model performs worse than predicting ȳ.Provides an honest estimate of out-of-sample predictive performance; the gold standard in machine learning.

R² and its advanced alternatives

As you progress through regression analysis and into topics like multiple regression, model selection, and machine learning, keep in mind that R² is the starting point — not the final word — on model evaluation. The adjusted R² addresses the overfitting issue for nested models, information criteria provide a framework for non-nested model comparison, and cross-validation gives the most realistic assessment of how your model will perform on new data. Mastering R² now builds the conceptual scaffolding upon which all these advanced techniques rest.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

A researcher reports R² = 0.82 for a simple linear regression predicting GPA from SAT score. Provide a complete interpretation of this value in context. Does this result imply that SAT score causes higher GPA? Explain your reasoning.
Show answer
An R² of 0.82 means that 82% of the variability in GPA across the sample is statistically explained by the linear relationship with SAT score. The remaining 18% is due to other factors not in the model (study habits, motivation, course difficulty, etc.). This does not imply causation — R² measures association only. There could be confounding variables that influence both SAT and GPA (e.g., socioeconomic status, quality of high school education). To establish causation, one would need a controlled experiment or a rigorous causal inference framework such as instrumental variables.

Question 2: BASIC CALCULATION

Given SST = 500 and SSE = 125, compute R² and SSR. What percentage of variance is unexplained?
Show answer
SSR = SST − SSE = 500 − 125 = 375. Therefore R² = SSR / SST = 375 / 500 = 0.75. Equivalently, R² = 1 − SSE / SST = 1 − 125/500 = 1 − 0.25 = 0.75. The model explains 75% of the variance in y. The percentage unexplained is 1 − R² = 0.25, or 25%. This 25% corresponds to the residual variation captured by SSE.

Question 3: INTERMEDIATE

A multiple regression model with 3 predictors and n = 25 observations yields R² = 0.68. Compute the adjusted R². A competing model with 5 predictors and the same sample gives R² = 0.72. Compute its adjusted R². Which model would you prefer based on adjusted R² and why?
Show answer
For the 3-predictor model: R²ₐdⱼ = 1 − [(1 − 0.68)(25 − 1)/(25 − 3 − 1)] = 1 − [(0.32)(24)/21] = 1 − 7.68/21 = 1 − 0.3657 = 0.634. For the 5-predictor model: R²ₐdⱼ = 1 − [(1 − 0.72)(25 − 1)/(25 − 5 − 1)] = 1 − [(0.28)(24)/19] = 1 − 6.72/19 = 1 − 0.3537 = 0.646. The 5-predictor model has a slightly higher adjusted R² (0.646 vs. 0.634), suggesting the two additional predictors provide enough explanatory improvement to justify the added complexity. However, the difference is small (0.012), so the researcher should also consider interpretability, multicollinearity, and substantive theory before choosing.

Question 4: APPLIED

An environmental scientist models particulate matter concentration (PM₂.₅ in μg/m³) as a function of traffic volume (vehicles/hour) using simple linear regression on data from n = 30 monitoring stations. The analysis yields: ŷ = 8.3 + 0.012x, SST = 4200, SSE = 1680. (a) Compute R². (b) Compute RMSE. (c) If the scientist adds two predictors (wind speed and temperature) and R² rises to 0.68 with SSE = 1344, compute the new adjusted R². (d) Is the more complex model justified? Discuss.
Show answer
(a) R² = 1 − SSE/SST = 1 − 1680/4200 = 1 − 0.40 = 0.60, so the traffic-only model explains 60% of variance in PM₂.₅. (b) RMSE = √(SSE/n) = √(1680/30) = √56 ≈ 7.48 μg/m³. (c) For the 3-predictor model: R²ₐdⱼ = 1 − [(1 − 0.68)(30 − 1)/(30 − 3 − 1)] = 1 − [(0.32)(29)/26] = 1 − 9.28/26 = 1 − 0.3569 = 0.643. For comparison, the 1-predictor model: R²ₐdⱼ = 1 − [(0.40)(29)/28] = 1 − 11.6/28 = 1 − 0.4143 = 0.586. (d) Adjusted R² increases from 0.586 to 0.643 with the additional predictors, suggesting the more complex model is justified. The improvement of about 5.7 percentage points in adjusted R² indicates that wind speed and temperature contribute meaningful explanatory power beyond traffic volume alone.

Question 5: CRITICAL THINKING

Consider two scenarios: (A) A researcher fits y = β₀ + β₁x + ε to 100 data points and obtains R² = 0.92, but a residual plot shows a clear U-shaped pattern. (B) A different researcher fits the same model form to different data and obtains R² = 0.45, with randomly scattered residuals. Which model is more trustworthy for making predictions? Explain why a high R² does not guarantee a well-specified model, and describe what diagnostic steps should accompany R² in evaluating model adequacy.
Show answer
Model B is more trustworthy despite its lower R². The U-shaped residual pattern in Model A indicates a systematic misspecification — the true relationship is likely nonlinear (e.g., quadratic), and the linear model is capturing the overall trend but missing the curvature. This means predictions from Model A will be systematically biased in certain regions of x, even though R² is high. Model B's randomly scattered residuals satisfy the linearity assumption, meaning the model form is appropriate and predictions are unbiased. This illustrates the critical point that R² measures variance explained but not model correctness. Diagnostics that should accompany R² include: (1) residual vs. fitted value plots to check linearity and homoscedasticity, (2) Q-Q plots to assess normality of residuals, (3) influence diagnostics (Cook's distance, leverage) to detect outliers, and (4) the Durbin-Watson test if data are sequential. A model is adequate only when R² is reasonable AND residual diagnostics reveal no systematic patterns.

SUMMARY

Lesson Summary

Summary

The coefficient of determination (R²) quantifies the proportion of variability in a response variable that is explained by a regression model. It is computed as R² = 1 − SSE / SST = SSR / SST, where SST (Total Sum of Squares) captures all variation in y, SSR (Regression Sum of Squares) captures the variation explained by the model, and SSE (Error Sum of Squares) captures the residual variation. In simple linear regression, R² equals the square of the Pearson correlation coefficient (r²). R² ranges from 0 (no explanatory power) to 1 (perfect fit) in standard OLS regression with an intercept.

While R² is intuitive and widely used, it has important limitations: it never decreases when predictors are added (necessitating adjusted R² for multiple regression), it does not assess model specification (always check residual plots), and it does not establish causation. Interpretation must be contextualized within the research domain, as acceptable R² values vary enormously across disciplines. Mastering R² equips you with the foundational goodness-of-fit metric upon which advanced tools — adjusted R², information criteria, RMSE, and cross-validated R² — are built.

Varsity Tutors • College Statistics • R² & Model Fit — Coefficient of Determination (R^2) and Model Fit