Residual Standard Error Calculator

Residual Standard Error Calculator

Find the typical distance between data points and a regression line, in the same units as your data, from raw X and Y values or from a sum of squared errors.

RSE = √(SSE ÷ (n − p − 1))

Enter at least 3 pairs of X and Y values

What is Residual Standard Error?

Residual standard error (RSE) is the typical size of a regression model's mistakes, in the same units as the thing you're predicting. An RSE of 2.1 minutes means predictions are usually within a couple of minutes of reality.

It's essentially the standard deviation of the residuals, with one difference: it divides by the degrees of freedom rather than n, because fitting the line used up some of the information in the data.

RSE complements R². R² says what share of the variation the model explains; RSE says how far off predictions actually are. A high R² with a large RSE can still be useless for precise forecasts.

Residual Standard Error Formula

As in James, Witten, Hastie and Tibshirani, An Introduction to Statistical Learning, section 3.1.3. See Sources.

1. Square and add the residuals

SSE = Σ(y − ŷ)²

2. Divide by the degrees of freedom

df = n − p − 1 (n − 2 for a straight line)

3. Take the square root

RSE = √(SSE ÷ df)

RSE² is the mean squared error of the regression, the MSE shown in an ANOVA table.

Worked Example: Delivery Time Against Distance

Given:
Eight deliveries: distance (km) 2, 5, 8, 10, 12, 15, 18, 20 and time (minutes) 12, 18, 24, 25, 31, 35, 42, 44.
Step 1:
Fit the line:
time = 8.709 + 1.7925 × distance
Step 2:
Squared residuals:
SSE = 6.1 · df = 8 − 2 = 6
Step 3:
Root:
√(6.1 ÷ 6) = 1.008 minutes
Result:
RSE ≈ 1 minutes

A delivery time estimated from distance will usually be within about 1 minutes, and almost always within 2. Useful for quoting customers a delivery window.

Why RSE Divides by Degrees of Freedom

The same SSE of 100 from different numbers of points and predictors. Dividing by n would understate the error, most of all in small samples.

RSE against the naive root mean square of residuals
nPredictorsRSE (÷ df)√(SSE ÷ n)
515.7744.472
1013.5363.162
1034.0823.162
3011.891.826
10051.0311

Common RSE Mistakes

  • Dividing by n. That's the RMSE of the residuals, which is biased low. RSE divides by n − p − 1.
  • Comparing RSE across different outcomes. RSE is in the outcome's units, so a model of minutes and a model of hours can't be compared directly.
  • Confusing it with relative standard error. "RSE" also abbreviates relative standard error, a percentage used in surveys. This page is the regression measure.
  • Using it as a prediction interval. A proper prediction interval also allows for uncertainty in the line itself, so it's a little wider than ±2 × RSE, especially far from the mean of X.

Residual Standard Error FAQs

What is a good RSE?

One small enough for your purpose. Compare it with the mean of Y and with the precision you need: 2 minutes might be fine for deliveries but not for a train timetable.

Where is RSE in R output?

summary(lm(...)) prints “Residual standard error: … on df degrees of freedom”.

Is RSE the same as the standard error of the regression?

Yes. It’s also called the standard error of the estimate, s, or σ̂. Excel’s regression output labels it “Standard Error”.

How does RSE relate to MSE?

RSE² equals the regression’s mean squared error (SSE ÷ df), the MS residual in an ANOVA table.

Can RSE be zero?

Only if every point lies exactly on the line, which almost never happens with real data.

Why does adding predictors sometimes increase RSE?

Each predictor uses up a degree of freedom. If it barely reduces SSE, the smaller df can push RSE up.

How do I calculate it in Excel?

=STEYX(y_range, x_range) gives the RSE for a straight-line fit.

Why give RSE as a share of the mean?

It puts the error in perspective: 2 minutes on a 30-minute average is about 7%.

Sources

Related Tools