Overview
Mean squared error, MSE, measures the average squared gap between a model's predictions and actual values. Lower is better. RMSE puts it back into the original units.
Enter the sum of squared errors (SSE), the sample size and the number of predictors.
Worked examples
| Inputs | Result |
|---|---|
| SSE (Sum Squared Error)120SST (Total Sum Squares)480Sample Size (n)60Number of Predictors3Residual for a Point-1.8 | Mean squared error (MSE): 2.14RMSE: 1.46 |
Show 2 more examples
| SSE (Sum Squared Error)50SST (Total Sum Squares)500Sample Size (n)30Number of Predictors1Residual for a Point0 | Mean squared error (MSE): 1.79RMSE: 1.34 |
| SSE (Sum Squared Error)300SST (Total Sum Squares)400Sample Size (n)100Number of Predictors5Residual for a Point0 | Mean squared error (MSE): 3.19RMSE: 1.79 |
Mean squared error (MSE) by sample size
With the calculator's starting values, the mean squared error (MSE) is 2.14. The table shows how it changes with the sample size.
| Sample Size (n) | Mean squared error (MSE) |
|---|---|
| 30 | 4.62 |
| 40 | 3.33 |
| 50 | 2.61 |
| 60starting value | 2.14 |
| 70 | 1.82 |
| 80 | 1.58 |
| 90 | 1.4 |
Other inputs: SSE: 120 Sum Squared Error · SST: 480 Total Sum Squares · Number of Predictors: 3 · Residual for a Point: -1.8. Change them in the calculator above for your own numbers.
How it works
Here MSE is SSE ÷ (n − predictors − 1), the residual mean square used in regression, which corrects for the parameters estimated. Some sources simply divide SSE by n. RMSE is √MSE, in the same units as your data.
The formula
| p | Number of predictors |
Practical tips
- SSE 120 with 60 observations and 3 predictors gives an MSE of 2.14 and an RMSE of 1.46.
- Dividing by n instead gives 2.0, which some machine learning tools report.
- Squaring means large errors count far more than small ones.
Frequently asked questions
MSE or RMSE?
RMSE is easier to interpret because it's in the data's units.
How is it different from MAE?
Mean absolute error doesn't square the errors, so it's less sensitive to outliers.
Why subtract predictors?
Each estimated parameter uses up a degree of freedom.