BY: Statistics Fundamentals Team
Reviewed By: Minsa A (Senior Statistics Editor)

R-Squared Visualizer: Understand R² with Interactive Regression Graphs

Drag data points and watch R², the regression line, residuals, and explained variance update in real time. This interactive visualizer makes the coefficient of determination tangible — see exactly what R² measures, how SST splits into SSR and SSE, and why outliers matter so much. Load a preset dataset or build your own from scratch.

R-Squared Visualizer

Formula R² = 1 − SSE / SST Equivalently SSR / SST
Click the scatter plot to add points. Drag existing points to move them. Double-click a point to remove it.
R² (coeff. of det.)
r (correlation)
n (data points)
Adj. R²
SST Total variance
SSR Explained variance
SSE Unexplained variance

Regression Equation

Equation
Slope (β₁)
Intercept (β₀)
Std error of est.

Model Fit

R² interpretation
Mean of x (x̄)
Mean of y (ȳ)
RMSE
Input format x, y pairs — one per line
Mode Real-world regression datasets

Select a preset dataset to load it into the visualizer. Each dataset demonstrates a different R² range and real-world context.

Dataset Examples

Click any example to load it into the visualizer above. Each shows a different R² range and real-world context.

What Is R-Squared (R²)?

R-squared (R²), also called the coefficient of determination, is a statistical measure that tells you what proportion of the variance in the dependent variable is explained by the independent variable(s) in a regression model. It ranges from 0 to 1. An R² of 0 means the model explains nothing; an R² of 1 means it explains everything perfectly. If your regression model has an R² of 0.85, it means 85% of the variation in y is accounted for by the model, and the remaining 15% is left unexplained.

First formalized by statistician Karl Pearson in the early 20th century, R² builds on the least-squares regression work of Francis Galton and Ronald Fisher. Today it appears in virtually every regression output — from Python's scikit-learn and R's lm() summary to Excel's LINEST function and SPSS output tables. Understanding what R² actually measures — and what it does not — separates competent data analysis from naive number-reading.

How R² Is Calculated: SST, SSR, and SSE

Regression decomposes the total variability in y into two parts: the part the model explains, and the part it does not.

SST — Total Sum of Squares: Measures total variance in y around its mean. SST = Σ(yᵢ − ȳ)². This is what you would use as your "error" if you always predicted ȳ.
SSR — Regression Sum of Squares (Explained): The variance in y that the regression line accounts for. SSR = Σ(ŷᵢ − ȳ)². A larger SSR means the model is doing more work.
SSE — Sum of Squared Errors (Unexplained): The remaining variance in y after fitting the line. SSE = Σ(yᵢ − ŷᵢ)². Each residual (yᵢ − ŷᵢ) squared and summed gives SSE.
The key identity: SST = SSR + SSE, always. R² = SSR / SST = 1 − SSE / SST. This is exactly what the visualizer above shows when you toggle variance shading.

How to Interpret R² Values

0.00–0.19Very weak fit. Most of the variance is unexplained. Common in social science data with many unmeasured confounders. Model may still have statistically significant predictors.
0.20–0.49Moderate fit. The model captures some structure. Acceptable in behavioral economics, psychology, and marketing analytics where human behavior is inherently noisy.
0.50–0.79Good fit. Typical in applied economics, healthcare outcomes research, and business forecasting. Worth reporting and acting on.
0.80–1.00Strong to perfect fit. Common in physical sciences, engineering, and calibrated measurement systems. Very high R² in social data can signal overfitting or multicollinearity.

R² vs Adjusted R²

Standard R² has a known problem: it always increases when you add more predictors to a multiple regression model, even if those predictors are pure noise. Adjusted R² corrects for this by penalizing model complexity. It is the right metric to report in multiple regression.

MetricFormulaRangeWhen to use
1 − SSE/SST0 to 1Simple linear regression with one predictor
Adjusted R²1 − (1−R²)·(n−1)/(n−k−1)Can be negativeMultiple regression — always prefer this over R²
r (Pearson correlation)SSR^0.5 / SST^0.5−1 to +1Bivariate relationship strength and direction
RMSE√(SSE / n)0 to ∞Prediction error in original units; model comparison
MSESSE / (n − 2)0 to ∞Unbiased variance estimate; hypothesis testing in regression

Common Misinterpretations of R²

High R² ≠ good predictions. A model can fit training data with R² = 0.98 and still predict new data poorly (overfitting). Always validate on held-out data.
Low R² ≠ useless model. In stock market prediction, an R² of 0.05 represents a meaningful edge. Context sets the benchmark, not an arbitrary threshold.
R² does not measure causation. A high R² between ice cream sales and drowning rates does not mean ice cream causes drowning — both are driven by summer temperatures. Correlation and causation remain distinct.
R² ignores residual patterns. Anscombe's Quartet contains four datasets with identical R² values (≈ 0.67) but completely different scatter plots. Always inspect residual plots alongside R².
R² increases with more predictors. Adding irrelevant variables inflates R². Use adjusted R², AIC, or BIC when comparing models with different numbers of predictors.

R² in Machine Learning

In machine learning, R² appears as a standard regression metric alongside RMSE and MAE. Scikit-learn's r2_score() function computes it on test set predictions. Unlike in classical statistics where R² is computed on training data, machine learning practice typically reports R² on a validation or test set. A model with training R² of 0.95 and test R² of 0.45 is clearly overfitting. The bias-variance tradeoff is the underlying reason for this gap.

R² Across Different Fields: Typical Benchmarks

FieldTypical R² rangeInterpretation
Physics / Engineering0.95–1.00High determinism; measurement error is the main noise source
Economics / Macroeconomics0.50–0.90Economic variables are highly correlated over time
Applied econometrics (cross-section)0.10–0.50Individual-level variation is substantial
Psychology / Behavioral science0.05–0.40Human behavior has many unmeasured determinants
Financial returns (daily)0.001–0.10Markets are near-efficient; small R² can still be profitable
Healthcare outcomes0.20–0.60Biological variability and lifestyle factors are substantial
Educational testing0.30–0.70Study time, socioeconomic factors, and ability all contribute

Entity Glossary

TermSymbolDefinition
R-Squared / Coefficient of DeterminationProportion of variance in y explained by the model. R² = 1 − SSE/SST
Adjusted R-SquaredR²adjR² penalized for number of predictors. Preferred in multiple regression
Regression Lineŷ = β₀ + β₁xLeast-squares line minimizing SSE; the predicted value of y at each x
Residualeᵢ = yᵢ − ŷᵢVertical distance between each observed point and the regression line
Total Sum of SquaresSSTΣ(yᵢ − ȳ)² — total variability in y around its mean
Regression Sum of SquaresSSRΣ(ŷᵢ − ȳ)² — variance in y explained by the model
Sum of Squared ErrorsSSEΣ(yᵢ − ŷᵢ)² — residual variance; unexplained portion
Pearson Correlation CoefficientrMeasures linear relationship strength and direction; r² = R² in simple regression
Standard Error of the EstimateSₑTypical distance of observed points from the regression line
RMSERMSERoot mean squared error; √(SSE/n). In original y units

Related Topics

Sources & further reading:

Frequently Asked Questions

An R² of 0.75 means the regression model explains 75% of the variance in the dependent variable. The remaining 25% is accounted for by factors not included in the model — measurement error, omitted variables, or inherent randomness. In most applied fields, R² = 0.75 represents a reasonably strong model. Whether it is "good enough" depends on the field: 0.75 is mediocre in physics but excellent in behavioral science.

No. R² can be artificially inflated by adding more predictors (even irrelevant ones), by overfitting training data, or by studying data where variables are highly correlated by construction (like time-series data with trends). A model with R² = 0.99 on training data that drops to R² = 0.40 on test data is a poor predictive model. Always complement R² with residual plots, cross-validation, adjusted R², and domain judgment.

Standard R² always increases (or stays the same) when you add predictors to a multiple regression model, even if those predictors have no real relationship with y. Adjusted R² corrects for this by penalizing the number of predictors: R²adj = 1 − (1 − R²) · (n − 1) / (n − k − 1), where k is the number of predictors. If adding a variable does not improve the model enough to justify the complexity cost, adjusted R² will decrease. In multiple regression, always report adjusted R².

In standard ordinary least-squares regression, R² is always between 0 and 1. However, R² computed as 1 − SSE/SST can be negative in specific situations: when the model is applied to out-of-sample data it was not trained on, when the intercept is suppressed (regression forced through the origin), or when a non-linear model is evaluated using the linear R² formula. A negative R² means the model's predictions are worse than simply always predicting the mean — the model has negative predictive value.

In real estate hedonic pricing models, R² of 0.65–0.85 is typical for models using predictors like square footage, number of bedrooms, location, and age of the property. A simple model using only house size might achieve R² of 0.50–0.60. Adding location-based variables (school district quality, walkability scores, proximity to amenities) typically pushes R² toward 0.75–0.85. Models below 0.50 with basic predictors available suggest missing important variables or data quality issues.

Outliers can dramatically change R². A single extreme point far from the regression line inflates SSE, which decreases R². Conversely, an influential point that lies far from the mean of x but close to the regression line can artificially inflate R² by "pulling" the line toward itself. This is why residual plots and influence measures (Cook's distance, leverage, DFFITS) are essential companions to R². Try dragging a point to an extreme position in the visualizer above — you will see R² drop immediately.

In multiple regression with k predictors, R² still equals 1 − SSE/SST and measures the proportion of variance in y explained by all k predictors together. The interpretation is the same as in simple regression, but two additional issues arise. First, R² will never decrease when adding predictors, so use adjusted R² for model comparison. Second, individual predictor contributions cannot be read from R² — you need standardized coefficients or relative importance analysis to understand each variable's role. Learn more in our Multiple Linear Regression guide.

R² summarizes model fit in one number, but it can mask serious problems. Always inspect residual plots: if residuals show a systematic curve (not random scatter around zero), linearity is violated — the relationship is non-linear. If residuals fan out as x increases, heteroscedasticity is present and standard errors are wrong. If residuals follow a wave pattern, autocorrelation exists (common in time series). A residual plot that looks like random horizontal noise around zero is what you want — it confirms the regression assumptions hold. The toggle-able residual lines in this visualizer let you develop that visual intuition.