Residual Calculator — Formula
## How to Calculate a Residual
### Formula
**Residual = Observed - Predicted = y - y_hat**
where y_hat = b0 + b1*x
A residual is the vertical distance between an observed data point and the regression line. Positive residuals mean the point is above the line; negative means below. In least-squares regression, the sum of all residuals is zero. Examining residuals helps detect model violations.
### Formula
**Residual = Observed - Predicted = y - y_hat**
where y_hat = b0 + b1*x
A residual is the vertical distance between an observed data point and the regression line. Positive residuals mean the point is above the line; negative means below. In least-squares regression, the sum of all residuals is zero. Examining residuals helps detect model violations.
Exemplo Resolvido
Regression: y = 5 + 2x. At x = 18, the observed y = 45.
- Predicted y_hat = 5 + 2*18 = 5 + 36 = 41
- Residual = 45 - 41 = 4
- The observed value is 4 units above the regression line
- Squared residual = 4^2 = 16