Deviations from the Mean and Median


The numbers 1, 2, 3, 7, 8, 9, 12 have a mean of 6 and median of 7.

The mean minimizes sum of squared deviations.
The sum of the squared deviations from the mean is:
(1-6)² + (2-6)² + (3-6)² + (7-6)² + (8-6)² + (9-6)² + (12-6)² = 25 +16 + 9 + 1 + 4 + 9 + 36 = 100.

From the median:
(1-7)² + (2-7)² + (3-7)² + (7-7)² + (8-7)² + (9-7)² + (12-7)² = 36 + 25 + 16 + 0 + 1 + 4 + 25 = 107.

The median minimizes sum of absolute deviations.
The sum of the absolute values of the deviations from the mean are:

| 5 + 4 + 3 + 1 + 2 + 3 + 6 = 24.

From the median:

6 + 5 + 4 + 0 + 1 + 2 + 5 = 23.