Skip to main content
v2026.11,858 entries · CC-BY 4.0

Standard Error of the Regression: Formula, Interpretation and Code

Learn what the standard error of the regression is, how to calculate it from residuals, interpret its units, report in APA style, and compute in R or Python.

Written and maintained by CASRAI Editorial Board

Last updated

The standard error of the regression—frequently denoted as S, se, or the se of regression—is a goodness-of-fit statistic in linear regression that measures the average distance observed values fall from the fitted line. While the coefficient of determination (R²) provides a unitless percentage of explained variance, the standard error of the regression evaluates model precision directly in the physical units of the dependent variable. By computing the square root of the residual mean square error, this metric reflects absolute prediction uncertainty, serving as an essential diagnostic benchmark for model evaluation and prediction interval construction across empirical research.

Definition in One Paragraph

The standard error of the regression is the estimated standard deviation of the population disturbance term, representing the average vertical distance between empirical data points and the fitted regression surface. Calculated as the square root of the sum of squared residuals divided by the residual degrees of freedom, the metric expresses error magnitude in the exact measurement units of the dependent variable. Unlike the standard error of an individual coefficient—which measures the sampling variability of a single parameter—the standard error of the regression assesses overall model fit: smaller values indicate that observations cluster tightly around the regression line, whereas larger values signify wider error dispersion and less precise individual forecasts.

Formula with Every Symbol Explained (SE of Regression)

Following the statistical framework published by the National Institute of Standards and Technology (NIST) in its e-Handbook of Statistical Methods (Section 4.4.3.1), the residual standard deviation (denoted σ̂ or se) is calculated as:

σ̂ = √( ∑ (yi − ŷi)² / (n − p) ) = √( SSR / (n − p) ) = √( MSE )

Every symbol in this formula represents an exact structural property of the regression model:

  • σ̂ (or se, S): The standard error of the regression, estimating the standard deviation (σ) of the random error term in the population.
  • yi: The observed value of the dependent variable for observation i.
  • ŷi: The fitted value generated by the regression equation for observation i.
  • yi − ŷi (or ei): The residual for observation i, measuring the vertical error from the regression line.
  • SSR: The sum of squared residuals, ∑ (yi − ŷi)², capturing unexplained variance.
  • n: The sample size (total number of observations).
  • p: The number of parameters estimated in the model, including the constant intercept (p = 2 for bivariate linear regression; p = k + 1 for multiple regression with k predictors).
  • n − p: The residual degrees of freedom.
  • MSE: The mean square error (residual variance), calculated as SSR / (n − p).

Worked Example with Real Numbers and Arithmetic Shown

To demonstrate the exact arithmetic, consider an experimental study evaluating study hours (predictor x) and quiz score (outcome y) across n = 5 participants with data pairs: (1, 2), (2, 2), (3, 5), (4, 6), and (5, 10).

Step 1: Compute Descriptive Sums and Parameter Estimates

First, calculate the sample means: x̄ = 15 / 5 = 3.0 and ȳ = 25 / 5 = 5.0. Next, calculate the sum of squared deviations for x and cross-products:

  • SSxx = (1−3)² + (2−3)² + (3−3)² + (4−3)² + (5−3)² = 4 + 1 + 0 + 1 + 4 = 10.0
  • SSxy = (1−3)(2−5) + (2−3)(2−5) + (3−3)(5−5) + (4−3)(6−5) + (5−3)(10−5) = 6 + 3 + 0 + 1 + 10 = 20.0

The estimated OLS slope and intercept are:

  • Slope (β₁) = SSxy / SSxx = 20.0 / 10.0 = 2.0
  • Intercept (β₀) = ȳ − β₁x̄ = 5.0 − (2.0 × 3.0) = −1.0

The fitted model is ŷ = −1.0 + 2.0x. For extended modeling principles, see our guide on linear regression and multiple regression.

Step 2: Tabulate Residuals and Sum of Squared Errors

Calculate fitted values, residuals (ei = yi − ŷi), and squared residuals (ei²):

Observation (i) xi yi ŷi = −1.0 + 2.0xi Residual (ei) ei²
1 1 2 1.0 +1.0 1.00
2 2 2 3.0 −1.0 1.00
3 3 5 5.0 0.0 0.00
4 4 6 7.0 −1.0 1.00
5 5 10 9.0 +1.0 1.00
Sum of Squared Residuals (SSR) ∑ ei = 0.00 SSR = 4.00

Step 3: Degrees of Freedom and Standard Error Calculation

With n = 5 and p = 2 parameters, calculate degrees of freedom and the standard error of the regression:

  • df = n − p = 5 − 2 = 3
  • MSE = SSR / df = 4.00 / 3 = 1.3333
  • S = √MSE = √1.3333 = 1.1547

The standard error of the regression is exactly 1.1547 quiz points, meaning observed test scores deviate from the fitted regression line by an average of 1.15 points.

Interpretation (What the Result Means with Reading Guidance)

Interpreting the standard error of the regression provides direct insight into model accuracy in the natural units of the outcome variable:

  1. Physical Scale Interpretation: Because S is expressed in original units (e.g., test points, dollars, or kilograms), it reflects the real-world scale of forecast uncertainty.
  2. Empirical 95% Prediction Rule: Under normally distributed residuals, roughly 68% of observations fall within ±1S of the regression line, and approximately 95% fall within ±2S. For this model (S = 1.1547), about 95% of future test scores will fall within ±(2 × 1.1547) ≈ ±2.31 points of their predicted score.
  3. Comparison to Outcome Standard Deviation: Comparing S to the standard deviation of y (sy) shows how much variance remains unexplained. Here, sy = 3.3912, so S / sy = 1.1547 / 3.3912 = 0.3405, indicating a 66% reduction in unexplained dispersion.
Statistic Scale / Formula Interpretation Focus Practical Function
Standard Error of Regression (S) √(SSR / (n − p)), units of Y Typical absolute distance of data from fitted line Quantifies individual forecast error and determines prediction interval width.
Coefficient of Determination (R²) 1 − (SSR / SST), unitless (0 to 1) Proportion of response variance explained Evaluates overall explanatory power across studies; insensitive to physical error scale.
Standard Error of Coefficient (SEβ) √(MSE / SSxx), units of Y/X Sampling variability of estimated slope Used in t-tests (t = b / SEb) and parameter confidence intervals.
Root Mean Square Error (RMSE) √(SSR / n), units of Y Sample residual magnitude without df adjustment Common in machine learning; slightly underestimates population error compared to S.

When selecting models, researchers frequently evaluate OLS metrics against penalized methods such as ridge vs. LASSO regression to balance variance and bias.

Assumptions and Common Mistakes

Valid application of the standard error of the regression requires satisfying core regression assumptions:

  • Homoscedasticity: Residual variance must remain constant across all predictor values (Var(ε) = σ²). Heteroscedasticity distorts S, overstating precision in high-variance regions and understating it in low-variance regions.
  • Model Linearity: If the true relationship is nonlinear, linear modeling produces structured residuals, inflating the SSR and artificially enlarging S.
  • Error Independence: Correlated errors—common in time series or clustered designs—distort effective sample size, leading to understated standard errors and artificially narrow intervals.
  • Normality of Errors: Approximate normality is required when using S to construct valid prediction intervals around fitted values.

Common Mistakes to Avoid

  • Confusing S with Parameter Standard Error: S measures how individual observations scatter around the fitted line in units of Y, whereas the standard error of the slope (SEb) reflects the theoretical sampling variance of the estimated coefficient across repeated samples.
  • Assuming High R² Means Small S: R² measures relative explained variance, while S measures absolute error. A model with R² = 0.95 predicting corporate valuations can have an S of several million dollars.
  • Neglecting Degrees of Freedom: Dividing SSR by sample size n rather than n − p yields a downward-biased estimate of disturbance variance. For related concepts in residual decomposition, see our guide on analysis of variance (ANOVA).

How to Report It (APA Example)

The American Psychological Association (APA 7th Edition) specifies clear conventions for reporting regression results in academic articles. Model-level fit metrics appear in narrative prose or within standardized summary tables.

APA Formatting Guidelines

  • Italics: Italicize symbols representing statistics (R, R², F, t, p, se). Do not italicize abbreviations such as SE, CI, or SD.
  • Leading Zeros: Omit leading zeros for numbers bounded by 1.0 (e.g., R² = .62, p = .027). Retain leading zeros for unbounded numbers (e.g., se = 1.15, F = 16.32).
  • Table Designations: Designate the metric as se, SEE (Standard Error of the Estimate), or Standard Error of the Regression in model summary tables.

Model Summary Table (APA 7th Style)

Table 1: Regression Model Summary for Study Hours Predicting Quiz Scores
Model R R² Adjusted R² se F df₁ df₂ p
1 .79 .62 .58 1.15 16.32 1 3 .027
Note. N = 5. se = standard error of the regression in quiz score units.

Narrative Reporting Example

A simple linear regression was conducted to evaluate quiz scores as a function of study hours. The overall model was statistically significant, F(1, 3) = 16.32, p = .027, with an R² of .62 (adjusted R² = .58) and a standard error of the regression se = 1.15 quiz points. Study hours significantly predicted quiz scores, b = 2.00, SE = 0.50, t(3) = 4.04, p = .027, 95% CI [0.42, 3.58].

How to Calculate It in Excel, R, or Python

Modern data analysis tools provide native functions to compute the standard error of the regression directly from raw data arrays.

1. Microsoft Excel

In Excel, calculate the standard error of the regression using STEYX or array extraction from LINEST:

# Method 1: Direct STEYX function (known_y's in B2:B6, known_x's in A2:A6)
=STEYX(B2:B6, A2:A6)

# Method 2: Extracting from LINEST (row 3, column 2 of output array)
=INDEX(LINEST(B2:B6, A2:A6, TRUE, TRUE), 3, 2)

Both formulas return 1.1547 for the worked example data.

2. R Language

In R, fit a linear model with lm() and extract the standard error of the regression using sigma():

# Assign data vectors
x = c(1, 2, 3, 4, 5)
y = c(2, 2, 5, 6, 10)

# Fit linear model
fit = lm(y ~ x)

# Extract standard error of regression (residual standard error)
ser_val = sigma(fit)
print(round(ser_val, 4))
# Output: [1] 1.1547

3. Python

In Python, compute the statistic using NumPy or statsmodels:

import numpy as np
import statsmodels.api as sm

x = np.array([1, 2, 3, 4, 5], dtype=float)
y = np.array([2, 2, 5, 6, 10], dtype=float)

# Method A: NumPy residual sum of squares calculation
b1, b0 = np.polyfit(x, y, deg=1)
residuals = y - (b0 + b1 * x)
n, p = len(x), 2
ser_numpy = np.sqrt(np.sum(residuals**2) / (n - p))
print(f"SER (NumPy): {ser_numpy:.4f}")

# Method B: statsmodels OLS model
X_const = sm.add_constant(x)
model = sm.OLS(y, X_const).fit()
ser_sm = np.sqrt(model.mse_resid)
print(f"SER (statsmodels): {ser_sm:.4f}")
# Output: 1.1547

Frequently Asked Questions

What is the difference between standard error of the regression and standard error of the mean?

The standard error of the mean (SEM) measures the sampling variability of the estimated mean of a single variable, calculated as SD / √n. The standard error of the regression measures the average dispersion of bivariate or multivariate data points around a fitted regression line, calculated as √(SSR / (n − p)), reflecting the precision of model predictions.

Can the standard error of the regression be greater than 1?

Yes. The standard error of the regression is an unstandardized statistic expressed in the actual measurement units of the dependent variable. If the outcome variable is measured in thousands of dollars, S is expressed in thousands of dollars and routinely exceeds 1.

Is a smaller standard error of the regression always better?

Within the same outcome scale and dataset, a smaller standard error of the regression indicates tighter clustering of empirical observations around the regression surface. However, an artificially depressed standard error can indicate overfitting when a model includes too many parameters relative to sample size.

How does the standard error of the regression relate to prediction intervals?

The standard error of the regression forms the baseline dispersion component of prediction intervals. Because an individual forecast must account for both parameter estimation uncertainty and the irreducible scatter of individual points, a 95% prediction interval is approximately ±2S wide around the fitted estimate.

Why is the standard error of the regression labeled differently across software packages?

Different software programs use distinct terms for the same concept. R reports it as the “Residual standard error”; SPSS designates it as “Std. Error of the Estimate”; Minitab refers to it as “S”; and Excel labels it “Standard Error” in regression summary tables and computes it via STEYX.

Sources

  • National Institute of Standards and Technology and SEMATECH. (2012). NIST/SEMATECH e-Handbook of Statistical Methods. Section 4.4.3.1: Residual Standard Deviation. https://www.itl.nist.gov/div898/handbook/pmd/section4/pmd431.htm (Accessed November 10, 2026).
  • R Core Team. (2026). R: A Language and Environment for Statistical Computing. Package stats, function summary.lm documentation: Residual Standard Error and Sigma. https://stat.ethz.ch/R-manual/R-patched/library/stats/html/summary.lm.html (Accessed November 10, 2026).
  • American Psychological Association. (2020). Publication Manual of the American Psychological Association (7th ed.). Section 6.44 (Statistical Symbols) and Section 8.35 (Regression and Analysis of Variance Tables). Washington, DC: American Psychological Association.
  • Statsmodels Development Team. (2026). Statsmodels: Econometric and Statistical Modeling with Python. Class RegressionResults (mse_resid and df_resid specifications). https://www.statsmodels.org/stable/generated/statsmodels.regression.linear_model.RegressionResults.html (Accessed November 10, 2026).
  • Wooldridge, J. M. (2020). Introductory Econometrics: A Modern Approach (7th ed.). Cengage Learning. Chapter 2: The Simple Regression Model.
  • Kutner, M. H., Nachtsheim, C. J., Neter, J., and Li, W. (2005). Applied Linear Statistical Models (5th ed.). McGraw-Hill/Irwin. Chapter 1: Linear Regression with One Predictor Variable.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Standard Error of the Regression: Formula, Interpretation and Code

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →