R-squared vs standard deviation of residuals
By Jude Wallis · Published
R-squared is the proportion of the variation in the response that the regression line explains, a unitless number from 0 to 1. The standard deviation of the residuals, , is the typical distance between an observed value and the line's prediction, in the units of the response.
AP Statistics: Unit 5 (topics 5.4 Residuals, 5.5 Least-Squares Regression). The coefficient of determination is interpreted in topic 5.5 and residuals are topic 5.4, both in Unit 5 of the Fall 2026 AP Statistics course. The standard deviation of the residuals is standard regression vocabulary that appears as S on computer output. The framework's topic titles do not name it, so treat that half as general statistics background.
R-squared vs s: the short answer
Both numbers describe how well a least-squares line fits, and both are built from the residuals, the differences between observed and predicted values. They answer different questions.
R-squared, written , is relative. It compares the line's misses with the misses you would make by ignoring and predicting the mean ("y-bar") for everyone. It reports the fraction of the variation in that the line accounts for.
The standard deviation of the residuals, written , is absolute. It reports the typical size of a prediction error, in the same units as .
A line can explain 98% of the variation and still miss by an amount that matters, or explain 50% and miss by an amount too small to care about. The two are reported together because each leaves out what the other shows.
What r-squared measures
The coefficient of determination is
The top of the fraction is the sum of squared residuals from the line. The bottom is the sum of squared deviations of from its mean, the total variation in the response. The fraction is the share of variation the line leaves unexplained, and is the rest.
For a least-squares line, equals the square of the correlation . It has no units and lies between 0 and 1. The standard interpretation: about percent of the variation in the response is explained by the linear relationship with the explanatory variable.
Changing the units of either variable leaves unchanged. That makes it easy to compare across data sets and impossible to read as a prediction error. What counts as a high value depends on the field, as what is a good r-squared value explains.
What the standard deviation of the residuals measures
The standard deviation of the residuals is
It uses the same sum of squared residuals as , divides by , and takes the square root, which returns the result to the units of . The interpretation: the actual response values typically differ from the values predicted by the line by about .
Because it carries units, can be judged against what matters in context. A typical miss of 2 points on a 100-point test is small. A typical miss of 2 grade levels in reading is large. The value is a typical miss, so individual residuals can be larger.
Changing the units of changes by the same factor. Convert the response from centimeters to millimeters and is multiplied by 10. Regression output usually prints it as S.
The differences side by side
| Feature | R-squared () | Standard deviation of residuals () |
|---|---|---|
| What it reports | Proportion of variation in explained by the line | Typical size of a prediction error |
| Units | None | Units of |
| Possible values | 0 to 1 | 0 or greater, no upper limit |
| A better fit means | A larger value | A smaller value |
| Compares the line with | Predicting for every case | Nothing, it is an absolute size |
| Effect of changing the units of | None | Scales with the units |
| Formula |
Both equal their best value when every point is exactly on the line: and .
How the two are linked
Both formulas contain the sum of squared residuals, so one can be written in terms of the other. With as the ordinary standard deviation of the response values,
This shows why neither number can stand in for the other. The value of depends on and on , how spread out the response values are to begin with. Two data sets of the same size with the same have different whenever their responses have different spreads. Two data sets of the same size with the same have different whenever one has more total variation for the line to explain.
For reasonably large the last fraction is close to 1, so is roughly . With , that is : a line that explains 75% of the variation cuts the typical prediction error only in half.
The classic mix-up and how to avoid it
The first error is reading as accuracy. ", so predictions are 85% accurate" and "85% of the points are on the line" are both wrong. The value 0.85 is a share of variation and says nothing in the units of the response. For the size of prediction errors, use .
The second error is interpreting without units or without the word typical. Write a full sentence in context, such as: the actual heights typically differ from the heights predicted by the line by about 1.73 centimeters.
The third error is treating either number as a check on whether a line is the right model. Curved data can produce a high and a small . The residual plot answers that question, as covered in how to interpret residual plots.
On computer output, keep three lines apart: S is the standard deviation of the residuals, R-Sq is , and the correlation is often not printed. When it is missing, you get by taking the square root of and attaching the sign of the slope.
Computing both from the same residuals
A plant's height in centimeters is recorded for six weeks. For weeks 1 through 6 the heights are 13, 12, 17, 19, 18, and 23. The least-squares line is . Find and , and interpret each.
Compute the predicted heights from for through 6: 12, 14, 16, 18, 20, 22.
Compute the residuals, observed minus predicted: , , , , , . They sum to 0.
Square and add the residuals: .
Find the mean height: .
Find the total variation. The deviations from 17 are -4, -5, 0, 2, 1, 6, and their squares sum to .
Compute .
Compute centimeters.
: about 85.4% of the variation in height is explained by the linear relationship with week. centimeters: the actual heights typically differ from the heights the line predicts by about 1.73 centimeters.
Same s, different r-squared
A second plant is measured over the same six weeks, with heights 17, 20, 29, 35, 38, and 47 centimeters and least-squares line . Find and for this plant and compare them with the first plant's values of 0.854 and 1.73 centimeters.
Compute the predicted heights from : 16, 22, 28, 34, 40, 46.
Compute the residuals: , , , , , . These are the same six residuals as the first plant, so their squares again sum to 12.
Compute centimeters, the same as before.
Find the mean height: .
Find the total variation. The deviations from 31 are -14, -11, -2, 4, 7, 16, and their squares sum to .
Compute .
Compare. The line misses by the same typical amount for both plants. The second plant grew much more over the six weeks, so there was far more variation in height to explain, and the same misses are a smaller share of it.
For the second plant and centimeters. Its is higher than the first plant's 0.854, yet predictions from the two lines are equally precise, with a typical error of 1.73 centimeters in both. A higher does not by itself mean smaller prediction errors.
Frequently asked questions
Does a higher r-squared always mean a smaller s?
Only when the comparison is within the same response data. Across different data sets it does not, because also depends on how spread out the response values are. Two lines can have the same with different , or the same with different .
Why does the formula for s divide by n minus 2?
Fitting a line estimates two quantities from the data, the slope and the intercept. Dividing by instead of accounts for that. With only two points the line passes through both, every residual is 0, and cannot be computed.
Which one should I use to describe how good my predictions are?
Use for the size of prediction errors, because it is in the units of the response and can be compared with what matters in context. Use to describe how much of the variation in the response the line accounts for. Check a residual plot before trusting either.