R-Squared Calculator
Calculate the coefficient of determination, R², from actual and predicted values. This calculator also shows SSE, SST, SSR, sample size, unexplained variation, and an easy interpretation of how well your regression model fits the observed data.
Enter Regression Data
Provide actual and predicted values for each observation.
What Is R-Squared?
R-squared, also called the coefficient of determination, is a statistical measure used to describe how much of the variation in an observed dependent variable is accounted for by a regression model.
R² is often expressed as either a decimal or a percentage. For example, an R² value of 0.80 corresponds to 80%, meaning that the fitted model accounts for 80% of the total variation in the observed outcome relative to the baseline mean model.
What Does a Higher R-Squared Mean?
In many standard regression settings, a higher R² indicates that the model's predictions are closer to the observed data relative to simply predicting the mean of the observations.
However, a high R² does not automatically mean that the model is useful, unbiased, correctly specified, or capable of making accurate predictions on new data.
How to Use the R-Squared Calculator
Enter Actual Values
Enter the observed values from your dataset in the Actual Values field.
Enter Predictions
Add the corresponding values predicted by your regression model in the Predicted Values field.
Calculate R²
The calculator computes error sums of squares, total variation, R², and the percentage of variation explained by the model.
How Is R-Squared Calculated?
A common definition of the coefficient of determination is: R² = 1 − SSE / SST
SSE is the sum of squared residual errors between the observed values and the predicted values. SST is the total sum of squares measuring variation in the observed values around their mean.
Sum of Squared Errors (SSE)
SSE is calculated using: SSE = Σ(y − ŷ)²
Smaller residual errors generally produce a smaller SSE and, all else equal, a larger R².
Total Sum of Squares (SST)
SST is calculated using: SST = Σ(y − ȳ)²
Here, y represents each observed value and ȳ represents the mean of all observed values.
How to Interpret an R-Squared Value
There is no universal R² value that defines a good model. Acceptable values depend heavily on the type of data, field of study, purpose of the model, noise level, and whether the model is intended for explanation or prediction.
| R² Range | General Fit Label | Simple Interpretation |
|---|---|---|
| Below 0 | Poor | Worse than predicting the observed mean |
| 0.00 – 0.24 | Weak | Explains a small portion of variation |
| 0.25 – 0.49 | Moderate | Explains some variation |
| 0.50 – 0.74 | Good | Explains a substantial portion of variation |
| 0.75 – 0.89 | Very Good | Strong fit to observed data |
| 0.90 – 1.00 | Excellent | Explains most observed variation |
Can R-Squared Be Negative?
Yes. When R² is calculated from arbitrary predicted values using the formula 1 − SSE/SST, the result can be negative. This happens when the model performs worse than a simple baseline that always predicts the mean of the observed values.
For ordinary least-squares regression fitted with an intercept to the same data used for estimation, R² is typically between 0 and 1. Other model setups and out-of-sample predictions can produce negative values.
R-Squared vs Correlation
R-squared and correlation are related concepts, but they are not always interchangeable. Correlation describes the strength and direction of association between variables, while R² commonly summarizes model fit in regression.
| Feature | R-Squared | Correlation |
|---|---|---|
| Main Purpose | Measure regression fit | Measure association |
| Typical Symbol | R² | r |
| Direction | Does not show positive/negative direction | Sign shows direction |
| Typical Range | Often 0 to 1, but may be negative | −1 to +1 |