Input a data set, and compute the Median Absolute Deviation (MAD) of them.
The Median Absolute Deviation (MAD) is a robust statistic used to evaluate data variability. Unlike standard deviation, MAD is based on the median, making it resistant to extreme values or outliers. It is ideal for analyzing datasets with irregularities.
For a dataset \( x_1, x_2, \dots, x_n \), the MAD is calculated as follows:
The formula for MAD is: \( MAD = \text{median}(|x_i - M|) \) Where:
Solution:
1. Find the median (\( M \)):
\( M = 3 \)
2. Compute absolute deviations:
|1 - 3| = 2
|2 - 3| = 1
|3 - 3| = 0
|4 - 3| = 1
|5 - 3| = 2
3. Find the median of the absolute deviations:
\( \text{Sorted deviations: } 0, 1, 1, 2, 2 \)
Median = 1
Result: The MAD for this dataset is 1.
Solution:
1. Find the median (\( M \)):
\( M = 15 \)
2.Compute absolute deviations:
|10 - 15| = 5
|15 - 15| = 0
|14 - 15| = 1
|20 - 15| = 5
|18 - 15| = 3
3. Find the median of the absolute deviations:
\( \text{Sorted deviations: } 0, 1, 3, 5, 5 \)
Median = 3
Result: The MAD for this dataset is 3.