01 / 21

\( R^2 \) & Model Fit

Understand how the coefficient of determination measures the proportion of variance explained by a regression model: from interpretation to common pitfalls.

AP Statistics

What Is \( R^2 \)?

The coefficient of determination, \( R^2 \), tells us the proportion of variance in the response variable \( y \) that is explained by the predictor variable(s) \( x \) in a regression model.

\( R^2 = 0 \)
The model explains none of the variation in \( y \).
\( R^2 = 1 \)
The model explains all of the variation in \( y \): a perfect fit.

Three Types of Variation

\( \text{SST} \)
Total Sum of Squares: measures total spread of \( y_i \) around \( \bar{y} \).
\( \text{SST} = \sum (y_i - \bar{y})^2 \)
\( \text{SSR} \)
Regression Sum of Squares: variation explained by the model.
\( \text{SSR} = \sum (\hat{y}_i - \bar{y})^2 \)
\( \text{SSE} \)
Error Sum of Squares: variation left unexplained (residuals).
\( \text{SSE} = \sum (y_i - \hat{y}_i)^2 \)

Visualizing Variation

x y \( \bar{y} \) \( \hat{y} \) Total: \(y_i - \bar{y}\) Residual: \(y_i - \hat{y}_i\) Explained: \(\hat{y}_i - \bar{y}\) Data points (\(y_i\)) Regression line (\(\hat{y}\)) Mean (\(\bar{y}\))

For any point, the total deviation from the mean is split into two parts: the deviation explained by the model, and the unexplained residual. \( R^2 \) measures the proportion of total variance that is explained variance.

The \( R^2 \) Formula

Form 1
\( R^2 = \frac{\text{SSR}}{\text{SST}} \): the ratio of explained variation to total variation.
Form 2
\( R^2 = 1 - \frac{\text{SSE}}{\text{SST}} \): one minus the ratio of unexplained to total variation.

Both forms are algebraically equivalent because \( \text{SST} = \text{SSR} + \text{SSE} \). Form 2 is more commonly used in software output.

\( R^2 \) vs. the Correlation \( r \)

\( R^2 \) \( r \)
Full name Coefficient of determination Pearson correlation coefficient
Range \( 0 \leq R^2 \leq 1 \) \( -1 \leq r \leq 1 \)
Sign Always non-negative Positive or negative
Interpretation % of variance explained Strength & direction of linear association
Relationship In simple linear regression: \( R^2 = r^2 \)

Interpreting \( R^2 \) Values

0.0 0.25 0.50 0.75 1.0 Weak Moderate Strong Very Strong

There is no universal "good" value for \( R^2 \): it depends on the field. In controlled lab experiments, \( R^2 > 0.90 \) is expected. In social sciences, \( R^2 \approx 0.30 \) may be excellent.

High vs. Low \( R^2 \)

\( R^2 = 0.95 \) \( R^2 = 0.15 \)

When \( R^2 \) is high, points cluster tightly around the regression line. When \( R^2 \) is low, points scatter widely: the line explains little of the variability.

\( R^2 \) Does Not Imply Causation

A high \( R^2 \) means the model describes the data well, but it does not prove that changes in \( x \) cause changes in \( y \). Two variables can be strongly correlated due to lurking variables or coincidence.

Good fit ≠ Good model
A polynomial of degree \( n-1 \) fits \( n \) data points perfectly (\( R^2 = 1 \)), yet it may have no predictive value whatsoever.
Context matters
Ice cream sales and drowning deaths are correlated (\( R^2 \) is high), but the lurking variable is summer heat: not causation.

How to Compute \( R^2 \)

1
Find the mean of the observed values: \( \bar{y} = \frac{1}{n}\sum y_i \).
2
Compute SST: \( \text{SST} = \sum (y_i - \bar{y})^2 \). This is the total variability.
3
Fit the regression model and obtain predicted values \( \hat{y}_i \).
4
Compute SSE: \( \text{SSE} = \sum (y_i - \hat{y}_i)^2 \). This is the unexplained variability.
5
Calculate: \( R^2 = 1 - \frac{\text{SSE}}{\text{SST}} \). Convert to a percentage for interpretation.

Example 1: Simple Computation

A dataset has \( \text{SST} = 200 \) and \( \text{SSE} = 50 \). Find \( R^2 \) and interpret.

Example 2: From Correlation to \( R^2 \)

A simple linear regression of hours of video games played per week (\( x \)) vs. GPA (\( y \)) yields a correlation of \( r = -0.80 \). Find \( R^2 \) and interpret.

Example 3: Comparing Two Models

Two regression models are fit to predict house price. Model A uses only square footage; Model B adds number of bedrooms. Which fits better?

Model A Model B
Predictors Sq. footage Sq. footage + bedrooms
\( R^2 \) 0.72 0.78
Variance explained 72% 78%

Adjusted \( R^2 \): The Penalty Term

Why adjust?
\( R^2 \) never decreases when you add a predictor, even a useless one. Adjusted \( R^2 \) penalizes model complexity.
When to use?
Use adjusted \( R^2 \) when comparing models with different numbers of predictors. It can decrease if a new predictor adds only noise.

Common Mistakes

✕ Assuming causation
A high \( R^2 \) shows strong association, not that \( x \) causes \( y \). Always check study design.
✕ Ignoring residual plots
\( R^2 \) can be high even if the linear model is wrong. A curved residual pattern means a non-linear model is needed.
✕ Comparing across datasets
\( R^2 = 0.60 \) in psychology is not "worse" than \( R^2 = 0.95 \) in physics. Context and inherent variability differ.

Summary: Key Concepts

Concept Key Point
\( R^2 \) Proportion of variance in \( y \) explained by the model; range \( [0, 1] \)
Formula \( R^2 = 1 - \frac{\text{SSE}}{\text{SST}} \)
\( R^2 \) vs. \( r \) In simple regression: \( R^2 = r^2 \); \( r \) has sign, \( R^2 \) does not
Adjusted \( R^2 \) Penalizes extra predictors; use for model comparison
Limitations Does not prove causation; inflated by overfitting; context-dependent

Question 1 of 5

A regression model has \( \text{SST} = 400 \) and \( \text{SSE} = 100 \). What is \( R^2 \)?

Question 2 of 5

If the Pearson correlation between hours of exercise and resting heart rate is \( r = -0.90 \), what is \( R^2 \)?

Question 3 of 5

A researcher reports \( R^2 = 0.64 \) for a model predicting test scores from study time. Which statement is the best interpretation?

Question 4 of 5

Model A has \( R^2 = 0.82 \) with 2 predictors. Model B has \( R^2 = 0.83 \) with 8 predictors. Which should you prefer, and why?

Question 5 of 5

A scatterplot shows a clear U-shaped curve, yet a simple linear regression yields \( R^2 = 0.02 \). What is the best conclusion?