The Median Absolute Deviation (MAD) Calculator helps you measure the typical deviation of data points from the median. Unlike the mean absolute deviation or standard deviation, MAD is extremely robust against outliers, making it ideal for skewed distributions or datasets with potential measurement errors. It provides an intuitive measure of dispersion in the original units of your data and is particularly useful in financial analysis, quality control, and analyzing datasets where you want to understand typical deviations without any influence from extreme values.
Quick Calculator
Need a quick calculation? Enter your numbers below, separated by commas:
Calculator
1. Load Your Data
2. Select a Column
Learn More
Median Absolute Deviation (MAD)
Definition
Median Absolute Deviation measures the median of the absolute differences between each data point and the median of all data points. It's a highly robust measure of statistical dispersion that is resistant to outliers and provides an intuitive scale estimate in the original units of measurement.
Formula
Median Absolute Deviation Formula:
Where:
- = the value of the -th observation
- = the median of all observations
- = the absolute difference between each value and the median
Consistent Estimator for Normal Distribution:
The factor 1.4826 makes the MAD consistent with the standard deviation for normally distributed data.
Interpretation Guidelines
Key Advantages
- Extremely robust against outliers, more so than mean absolute deviation or standard deviation
- Uses the same units as the original data
- Excellent for skewed distributions or data with measurement errors
- Can be easily converted to estimate standard deviation for normally distributed data
Step by Step Example
Let's calculate the median absolute deviation for a dataset of daily temperatures (in °C) for a week:
Day | Temperature (°C) |
---|---|
Monday | 22 |
Tuesday | 20 |
Wednesday | 25 |
Thursday | 21 |
Friday | 23 |
Saturday | 24 |
Sunday | 19 |
Median Absolute Deviation Calculation
Step 1: Calculate the median temperature. First, sort the data: 19, 20, 21, 22, 23, 24, 25
(middle value of the sorted data)Step 2: Calculate the absolute deviations from the median:
Day | Temperature (°C) | Deviation from Median | Absolute Deviation |
---|---|---|---|
Monday | 22 | 22 - 22 = 0 | |0| = 0 |
Tuesday | 20 | 20 - 22 = -2 | |-2| = 2 |
Wednesday | 25 | 25 - 22 = 3 | |3| = 3 |
Thursday | 21 | 21 - 22 = -1 | |-1| = 1 |
Friday | 23 | 23 - 22 = 1 | |1| = 1 |
Saturday | 24 | 24 - 22 = 2 | |2| = 2 |
Sunday | 19 | 19 - 22 = -3 | |-3| = 3 |
Step 3: Find the median of the absolute deviations. First, sort the absolute deviations: 0, 1, 1, 2, 2, 3, 3
Step 4 (Optional): Calculate the consistent estimator for normal distribution:
Interpretation: A MAD of 2°C indicates that the typical deviation from the median temperature during the week is 2°C. The consistent estimator value of 2.97°C provides a robust alternative to standard deviation that is not influenced by outliers.
Comparing Different Measures of Dispersion
Different measures of dispersion serve different purposes and have different strengths and weaknesses:
Feature | Median Absolute Deviation | Mean Absolute Deviation | Standard Deviation | Interquartile Range (IQR) |
---|---|---|---|---|
Formula Base | Median of absolute deviations from the median | Mean of absolute deviations from the mean | Square root of the average squared deviations from the mean | Difference between 75th and 25th percentiles |
Outlier Sensitivity | Extremely resistant to outliers | Moderately resistant to outliers | Highly sensitive to outliers | Very resistant to outliers |
Mathematical Properties | Limited mathematical tractability | Limited mathematical tractability | Excellent mathematical properties | Limited mathematical tractability |
Best Used For | Heavily skewed data, data with outliers, or when extreme robustness is required | When a balance between robustness and interpretability is needed | When data is approximately normally distributed and mathematical properties are important | When describing the middle 50% of the data is appropriate |
When to Use Median Absolute Deviation
- When working with data that may contain extreme outliers or measurement errors
- In robust statistics where sensitivity to outliers must be minimized
- When analyzing financial data where extreme values (market crashes, bubbles) shouldn't skew the results
- In quality control applications where typical variation is more important than occasional extreme deviations
How to Calculate Median Absolute Deviation in R
R provides a built-in function mad() for calculating the median absolute deviation. Unlike many other software packages, R's mad() function automatically multiplies the result by the constant 1.4826 to make it consistent with the standard deviation for normally distributed data.
library(tidyverse)
data <- c(22, 20, 25, 21, 23, 24, 19)
# median absolute deviation by default
mad(data) # Returns 2.9652 (which is 2 × 1.4826)
# MAD without the constant factor
mad(data, constant = 1) # Returns 2
data(tips, package = "reshape2")
# MAD of total bill
mad(tips$total_bill)
# compare with standard deviation
sd(tips$total_bill)
# compare with mean absolute deviation
mean(abs(tips$total_bill - mean(tips$total_bill)))