Table of Contents
In statistical analysis, understanding the difference between observed data points and the values predicted by a model is fundamental. This difference is known as a residual. Specifically, within a regression model, the residual quantifies the error for a given observation.
The calculation of a residual is straightforward:
Residual = Observed value – Predicted value
When plotting observed data points alongside the fitted regression line, the residual for each point represents the precise vertical distance between that observation and the line of best fit.

The Importance of Standardized Residuals in Model Diagnostics
While simple residuals are useful, they do not account for the varying influence or leverage that different observations might have on the regression line. This is where the standardized residual becomes a crucial diagnostic tool, especially for identifying unusual data points or outliers in the model.
A standardized residual is calculated by dividing the raw residual by its standard deviation, adjusting for the leverage of that observation. The formula is defined as follows:
ri = ei / s(ei) = ei / RSE√1-hii
The components of this formula are essential for accurate interpretation:
- ei: The ith raw residual (Observed Y minus Predicted Y).
- RSE: The Residual Standard Error of the entire regression model.
- hii: The leverage of the ith observation.
Statisticians typically use standardized residuals to flag potential outliers. A common rule of thumb suggests that any standardized residual with an absolute value greater than 3 merits investigation as a serious outlier. This tutorial will walk you through the practical steps of performing this complex calculation using Microsoft Excel.
Step 1: Entering and Organizing the Dataset
To begin the process in Excel, we must first input our dataset. For this example, we will use a small collection of paired (X, Y) values. Ensure your independent variables (X) and dependent variables (Y) are clearly labeled and separated into adjacent columns.
Here is the sample data organized in the spreadsheet:

This initial organization is crucial for the successful execution of the regression analysis in the next step.
Step 2: Running Regression and Calculating Raw Residuals
The raw residuals are automatically generated when running a regression analysis using Excel’s built-in tools. To access these tools, navigate to the Data tab located on the top ribbon. Within the Analysis group, click on Data Analysis.
If the Data Analysis option is not visible, you must install the Analysis ToolPak Add-in. This is a free and straightforward process that enables advanced statistical functions in Excel.
When the Data Analysis window appears, select the Regression option and click OK. You will then need to configure the following inputs in the subsequent dialogue box before clicking OK again:
- Input Y Range: Select the column containing your dependent variable (Y).
- Input X Range: Select the column(s) containing your independent variable(s) (X).
- Crucially, check the box labeled Residuals to ensure the raw residuals are included in the output report.

Upon execution, the regression output will be generated, including a dedicated section detailing the raw residuals for every data point.

For ease of calculation in the subsequent steps, copy and paste these raw residual values into a new, clearly labeled column adjacent to your original data.

Step 3: Calculating the Leverage (hii) for Each Observation
To calculate the standardized residual, we must first determine the leverage (hii) for each observation. Leverage measures how far an observation’s predictor values are from the mean of the predictor values, indicating its potential influence on the regression line. For simple linear regression (one X variable), the leverage calculation is as follows: hii = 1/n + (xi – x)2 / Σ(xj – x)2.
To implement this in Excel, we first need to calculate three auxiliary values based on the independent variable (X): the count (n), the mean (x), and the sum of squared deviations (Σ(xj – x)2).

The following formulas were used in the cells shown above to derive the necessary components and the final leverage values (assuming X data is in B2:B13):
- B14 (n):
=COUNT(B2:B13)(Counts the number of observations) - B15 (Mean X):
=AVERAGE(B2:B13)(Calculates the mean of X) - B16 (Sum of Squared Deviations):
=DEVSQ(B2:B13)(Calculates Σ(xj – x)2) - E2 (Leverage hii):
=1/$B$14+(B2-$B$15)^2/$B$16(This formula is then dragged down for all observations)
Step 4: Deriving the Standardized Residuals
With the raw residuals (ei) and the leverage values (hii) calculated, we must now incorporate the Residual Standard Error (RSE) to find the final standardized residual (ri).
The formula for the standardized residual is:
ri = ei / RSE√1-hii
The RSE represents the average distance that the observed values fall from the regression line and is extracted directly from the summary output generated in Step 2. In our example, the RSE value is listed as the “Standard Error” and equals 4.44.

Using this constant RSE value (4.44) and the calculated raw residuals (Column C) and leverage values (Column E), we can construct the final Excel formula for the standardized residual in Column F:

Step 5: Interpreting Results and Identifying Outliers
The final column provides the standardized residual for every observation. These values allow for an easy assessment of how unusual each data point is, independent of its leverage.
Based on the calculated results, we observe that none of the standardized residuals have an absolute value exceeding 3. Therefore, under the widely accepted statistical threshold, there is no evidence to suggest that any observation in this dataset is a significant outlier.
It is important to note that while an absolute value of 3 is a common benchmark for outlier detection, some researchers prefer a more conservative threshold, such as an absolute value of 2. The choice between these thresholds often depends on the specific domain, the size of the dataset, and the required sensitivity of the statistical analysis.
Additional Resources
Cite this article
Mohammed looti (2025). Calculate Standardized Residuals in Excel. PSYCHOLOGICAL STATISTICS. Retrieved from https://statistics.arabpsychology.com/calculate-standardized-residuals-in-excel/
Mohammed looti. "Calculate Standardized Residuals in Excel." PSYCHOLOGICAL STATISTICS, 6 Nov. 2025, https://statistics.arabpsychology.com/calculate-standardized-residuals-in-excel/.
Mohammed looti. "Calculate Standardized Residuals in Excel." PSYCHOLOGICAL STATISTICS, 2025. https://statistics.arabpsychology.com/calculate-standardized-residuals-in-excel/.
Mohammed looti (2025) 'Calculate Standardized Residuals in Excel', PSYCHOLOGICAL STATISTICS. Available at: https://statistics.arabpsychology.com/calculate-standardized-residuals-in-excel/.
[1] Mohammed looti, "Calculate Standardized Residuals in Excel," PSYCHOLOGICAL STATISTICS, vol. X, no. Y, ص Z-Z, November, 2025.
Mohammed looti. Calculate Standardized Residuals in Excel. PSYCHOLOGICAL STATISTICS. 2025;vol(issue):pages.