What is Residual Sum of Squares (RSS) in regression?

Tiya Vaj
2 min readOct 9, 2024

--

RSS stands for “Residual Sum of Squares. It’s a common measure used in statistics and regression analysis to assess how well a model fits the data. Here’s a simple explanation:

### What is RSS?

1. Residuals: When you create a regression model, it makes predictions based on the input data. The difference between the actual values (what you observe) and the predicted values (what your model predicts) is called a residual. In other words:

Residual} = Actual Value — Predicted Value

2. Squaring the Residual: To avoid negative values canceling out positive values and to give more weight to larger errors, we square each residual:

Squared Residual = Residual²

3. Summing the Squared Residuals: Finally, RSS is the total of all these squared residuals:


This means you add up all the squared differences between the actual and predicted values.

### Why is RSS Important?

  • Goodness of Fit: A lower RSS value indicates that the model’s predictions are closer to the actual values, which means the model fits the data well.
  • A higher RSS suggests that the model is not capturing the underlying patterns in the data effectively.

    - Model Comparison: RSS can help compare different models. A model with a lower RSS is generally considered better than one with a higher RSS, given that both are applied to the same dataset.

### Example

Imagine you’re trying to predict the height of plants based on how much water they get. If your model predicts the heights as follows:

| Actual Height (cm) | Predicted Height (cm) | Residual |
| — — — — — — — — — — -| — — — — — — — — — — — -| — — — — — |
| 30 | 28 | 2 |
| 40 | 42 | -2 |
| 50 | 48 | 2 |

1. Calculate Residuals:
— For the first plant: (30–28 = 2)
— For the second plant: (40–42 = -2)
— For the third plant: (50–48 = 2)

2. Square the Residuals:
— (2² = 4)
— ((-2)² = 4)
— (2² = 4)

3. Calculate RSS:

(RSS = 4 + 4 + 4 = 12)

In this example, the RSS of 12 tells you how well your model is doing. The lower the RSS, the better your model predicts the heights of the plants!

--

--

Tiya Vaj
Tiya Vaj

Written by Tiya Vaj

Ph.D. Research Scholar in NLP and my passionate towards data-driven for social good.Let's connect here https://www.linkedin.com/in/tiya-v-076648128/