STEYX function
Returns the standard error of the predicted y-values in a linear regression: the typical size of the prediction error.
Available in All versions of Excel, including Microsoft 365 and Excel for the web
In every Excel versionWorks in Google Sheets
Syntax
STEYX(known_y's, known_x's)| Argument | What it means | |
|---|---|---|
known_y's | Required | The dependent values. |
known_x's | Required | The independent values, same number of points. |
Returns: The standard error of the estimate, in the units of y.
How STEYX works
After fitting a straight line with SLOPE and INTERCEPT, the next question is "how far off are the predictions, typically?". STEYX answers it. It measures the scatter of the actual points around the regression line, in the same units as y. If STEYX is 0.87 (thousand euros), predictions from the line are usually within about one thousand euros of reality.
The calculation squares the vertical distances from each point to the line, adds them up, divides by n − 2 (two parameters were estimated) and takes the square root. It is the same number as row 3, column 2 of LINEST with statistics. A rough 95% band for an individual prediction is the predicted value ± 2 × STEYX (slightly wider far from the middle of the data).
Examples
1Typical prediction error for sales
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Ad spend (k) | Sales (k) | ||
| 2 | 2 | 41 | 0.8746 | |
| 3 | 4 | 52 | ||
| 4 | 5 | 58 | ||
| 5 | 7 | 70 | ||
| 6 | 9 | 79 |
Result: 0.8746
0.874551 (shown to 4 decimals): sales predictions from ad spend are typically off by under 1k.
2Error band for delivery-cost model
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Km | Cost | ||
| 2 | 10 | 28 | 3.81 | |
| 3 | 25 | 52 | ||
| 4 | 40 | 81 | ||
| 5 | 55 | 98 | ||
| 6 | 70 | 131 |
Result: 3.81
3.812261 (shown to 2 decimals). A quote of predicted cost ± 2 × this value would cover most real costs.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A | The ranges have different numbers of points. | Use ranges of equal size. |
#DIV/0! | Fewer than three data points. | STEYX needs at least three points (n − 2 > 0). |
Tips
- Compare STEYX with the average of y to judge whether the error is small in context.
- For forecast intervals at a specific x, Excel's FORECAST.ETS.CONFINT works for time series; for regression build the interval from STEYX and T.INV.2T.
Google Sheets
STEYX also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
STEYX in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Danish | STFYX |
| Dutch | STAND.FOUT.YX |
| Finnish | KESKIVIRHE |
| French | ERREUR.TYPE.XY |
| German | STFEHLERYX |
| Hungarian | STHIBAYX |
| Italian | ERR.STD.YX |
| Norwegian (Bokmål) | STANDARDFEIL |
| Polish | REGBŁSTD |
| Portuguese (Brazil) | EPADYX |
| Portuguese (Portugal) | EPADYX |
| Russian | СТОШYX |
| Spanish | ERROR.TIPICO.XY |
| Swedish | STDFELYX |
| Turkish | STHYX |