StatsCalculators.com

Median Absolute Deviation

Created:April 14, 2025

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

Note: Column names will be converted to snake_case (e.g., "Product ID" → "product_id") for processing.

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:

MAD=median(ximedian(X))\text{MAD} = \text{median}(|x_i - \text{median}(X)|)

Where:

  • xix_i = the value of the ii-th observation
  • median(X)\text{median}(X) = the median of all observations
  • ximedian(X)|x_i - \text{median}(X)| = the absolute difference between each value and the median

Consistent Estimator for Normal Distribution:

σ^=1.4826×MAD\hat{\sigma} = 1.4826 \times \text{MAD}

The factor 1.4826 makes the MAD consistent with the standard deviation for normally distributed data.

Interpretation Guidelines

Lower MAD values indicate data points are closer to the median (less spread)
Higher MAD values indicate data points are further from the median (more spread)
MAD is measured in the same units as the original data, making it directly interpretable
For normally distributed data, MAD multiplied by 1.4826 approximates the standard deviation

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:

DayTemperature (°C)
Monday22
Tuesday20
Wednesday25
Thursday21
Friday23
Saturday24
Sunday19

Median Absolute Deviation Calculation

Step 1: Calculate the median temperature. First, sort the data: 19, 20, 21, 22, 23, 24, 25

median=22°C\text{median} = 22°C (middle value of the sorted data)

Step 2: Calculate the absolute deviations from the median:

DayTemperature (°C)Deviation from MedianAbsolute Deviation
Monday2222 - 22 = 0|0| = 0
Tuesday2020 - 22 = -2|-2| = 2
Wednesday2525 - 22 = 3|3| = 3
Thursday2121 - 22 = -1|-1| = 1
Friday2323 - 22 = 1|1| = 1
Saturday2424 - 22 = 2|2| = 2
Sunday1919 - 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

MAD=median(0,1,1,2,2,3,3)=2°C\text{MAD} = \text{median}(0, 1, 1, 2, 2, 3, 3) = 2°C

Step 4 (Optional): Calculate the consistent estimator for normal distribution:

σ^=1.4826×MAD=1.4826×2=2.97°C\hat{\sigma} = 1.4826 \times \text{MAD} = 1.4826 \times 2 = 2.97°C

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:

FeatureMedian Absolute DeviationMean Absolute DeviationStandard DeviationInterquartile Range (IQR)
Formula BaseMedian of absolute deviations from the medianMean of absolute deviations from the meanSquare root of the average squared deviations from the meanDifference between 75th and 25th percentiles
Outlier SensitivityExtremely resistant to outliersModerately resistant to outliersHighly sensitive to outliersVery resistant to outliers
Mathematical PropertiesLimited mathematical tractabilityLimited mathematical tractabilityExcellent mathematical propertiesLimited mathematical tractability
Best Used ForHeavily skewed data, data with outliers, or when extreme robustness is requiredWhen a balance between robustness and interpretability is neededWhen data is approximately normally distributed and mathematical properties are importantWhen 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.

R
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)))

Related Calculators