Calculators
Home › Calculators › R-Squared Calculator

R-Squared Calculator

The share of variation a regression accounts for, two ways in.

Calculate R-squared

Fit it from data, or square a correlation you already have.

Quick answer: R-squared = SS regression / SS total. Hours to marks: 324.9 / 328 = 0.991. Shortcut with one predictor: square r. r = 0.8 gives R-squared = 0.64.

The share of variation, explained

R², the coefficient of determination, answers a plain question: of all the variation in the outcome, how much does the regression account for? It is a proportion between 0 and 1, often read as a percentage. R² = 0.25 means the model accounts for a quarter of the variation; the rest belongs to other causes and noise.

Coefficient of determinationR² = SSregression ÷ SStotal = 1 − SSresidual ÷ SStotal
Worked example

For the study-hours regression (marks 50, 55, 60, 68, 72 on hours 2 to 6): total variation SStotal = 328, the fitted line accounts for 324.9 of it, and 3.1 is left as residual scatter. R² = 324.9 ÷ 328 = 0.991. Hours account for 99.1% of the variation in marks in this tiny dataset. It also equals r² = 0.995², which is the shortcut the calculator's second mode uses: enter r = 0.8 and get R² = 0.64.

What R-squared does not say

R² is silent about causation, in both directions. A confounded model can score 0.99; a true causal effect buried in noisy data can score 0.05. It is also silent about whether the model's shape is right: a straight line through curved data can post a decent R² while missing the pattern completely. And it always rises when predictors are added, which is why the adjusted version exists: it charges each predictor rent and can fall when a passenger variable joins the model.

Watch out

Chasing R² by adding predictors. With enough variables you can fit noise itself: twenty random predictors on twenty-five observations will produce a handsome R² and predict nothing. Adjusted R², and checking predictions on fresh data, are the guards.

R-squared in the wild

Benchmarks vary enormously by field. Models of physical systems post 0.95 and up. Models of human behaviour often live at 0.1 to 0.4 and still guide real decisions. Judge a value against its own literature, never against a universal scale.

Frequently asked questions

Is R-squared the same as r-squared?

In simple linear regression, yes, exactly: R-squared equals the square of Pearson's r. In multiple regression, R-squared generalizes the idea and no single r produces it.

Can R-squared be negative?

The in-sample value from a least-squares fit with an intercept cannot. An out-of-sample R-squared, or one from a model forced through the origin, can go negative: the model then does worse than predicting the mean every time.

What is a good R-squared?

There is no universal threshold. 0.99 in a behaviour study should trigger suspicion, not celebration; 0.2 in the same study might be a publishable effect. Compare within the field.

Does a high R-squared mean the model predicts well?

It means the model fits the data it was trained on. Prediction is a claim about new data. Overfit models fit beautifully and predict badly.