Residual RechnerFormel

## 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.

Lösungsbeispiel

Regression: y = 5 + 2x. At x = 18, the observed y = 45.

  1. Predicted y_hat = 5 + 2*18 = 5 + 36 = 41
  2. Residual = 45 - 41 = 4
  3. The observed value is 4 units above the regression line
  4. Squared residual = 4^2 = 16