Median Absolute Deviation (MAD) Calculator

Calculate MAD, scaled MAD, mean absolute deviation, and MAD-based outlier detection. Compare robust vs classical spread measures with visual breakdown.

About the Median Absolute Deviation (MAD) Calculator

The median absolute deviation (MAD) is a robust measure of spread built from the median rather than the mean. It takes the median of the absolute distances from the dataset's median, which makes it much less sensitive to outliers than standard deviation.

This calculator reports the raw MAD, the scaled MAD used as a standard-deviation analogue under normality, the mean absolute deviation, and a MAD-based outlier view. The comparison section helps show how strongly a few extreme points may be stretching the classical spread measures relative to the robust ones.

It is especially useful when you suspect a dataset contains outliers, skew, or contamination that would make mean-based spread summaries misleading.

Why Use This Median Absolute Deviation (MAD) Calculator?

MAD is valuable when you want to know how variable the main body of the data is without letting a few extreme observations dominate the answer. That is why it appears so often in robust statistics, anomaly detection, and pre-analysis data screening.

Putting MAD beside scaled MAD, mean absolute deviation, and standard deviation makes it easier to see whether the dataset is broadly noisy or whether a handful of points are doing most of the damage.

How to Use This Calculator

  1. Enter numbers separated by commas or spaces (minimum 2 values).
  2. Select whether deviations are measured from the median (standard MAD) or mean.
  3. Choose whether to scale MAD by 1.4826 for normal distribution comparison.
  4. Read the MAD from the main output — it measures typical deviation robustly.
  5. Compare MAD to standard deviation in the bar chart: large differences signal outliers.
  6. Check the deviation table to see which values are flagged as outliers.
  7. Review the robustness reference table to understand each measure's strengths.

Formula

MAD = median(|xᵢ − median(x)|). Scaled MAD = 1.4826 × MAD (≈ σ for normal data). Mean Absolute Deviation = Σ|xᵢ − center| / n. Outlier threshold: |xᵢ − median| > 3 × scaled MAD.

Example Calculation

Result: MAD = 2, Scaled MAD = 2.9652

Median = 25. Absolute deviations: |22−25|=3, |25−25|=0, |27−25|=2, ... Sorted |deviations|: 0,1,1,2,2,3,3,65. MAD = median = 2. Scaled MAD = 2 × 1.4826 = 2.9652. The value 90 has |90−25|/2.97 = 21.9 MADs from center — a clear outlier.

Tips & Best Practices

MAD in Robust Statistics

Peter Huber popularized MAD as a robust scale estimator in the 1960s and 70s. It forms the foundation of many robust statistical methods: M-estimators use MAD for initial scale estimates, robust regression uses MAD to identify influential outliers, and anomaly detection systems use MAD-based thresholds because they resist "masking" (where a cluster of outliers makes classical methods fail to flag any of them).

MAD in Signal Processing

In signal processing, MAD is used to estimate the noise level in a signal. The "universal threshold" for wavelet denoising is λ = MAD × √(2 ln n) / 0.6745, where MAD is computed from the finest-scale wavelet coefficients. This approach is robust because signal components don't corrupt the noise estimate.

Computational Considerations

MAD requires sorting (O(n log n)) or can use a selection algorithm (O(n)). For streaming data, approximate MAD can be maintained with P² quantile estimators or binned approaches. In distributed systems, MAD is harder to compute than mean/SD because median is not decomposable — but approximate distributed MAD algorithms exist.

Sources & Methodology

Last updated:

Frequently Asked Questions

What is the median absolute deviation?

MAD is calculated in two steps: (1) find the median of your data, (2) compute the absolute deviation of each value from the median, then find the median of those deviations. It measures "typical" distance from the center using the most robust possible approach — both the center (median) and the spread (median of deviations) resist outliers.

Why multiply MAD by 1.4826?

The factor 1.4826 (= 1/Φ⁻¹(3/4) where Φ is the normal CDF) makes the scaled MAD a consistent estimator of the standard deviation when data is normally distributed. Without scaling, MAD is about 67.45% of the SD for normal data. The scaling lets you directly compare MAD to SD.

What is a breakdown point?

The breakdown point is the fraction of data that can be arbitrary (outliers) before a statistic becomes unreliable. MAD has a 50% breakdown point — the highest possible. Standard deviation has a 0% breakdown point — even a single extreme outlier can make it arbitrarily large. IQR has a 25% breakdown point.

How is MAD different from mean absolute deviation?

MAD uses the median of absolute deviations (from the median), while mean absolute deviation uses the mean of absolute deviations (from the mean or median). MAD is much more robust because it uses the median twice. Mean absolute deviation is affected by every data point and has no outlier resistance.

When should I use MAD instead of standard deviation?

Use MAD when (1) data may contain outliers, (2) the distribution is skewed, (3) you need a robust preprocessing step before formal analysis, or (4) you're comparing groups where some may have contaminated data. MAD is especially common in signal processing, anomaly detection, and robust regression.

How does MAD-based outlier detection work?

Compute the modified z-score: zᵢ = |xᵢ − median| / (1.4826 × MAD). Values with |zᵢ| > 3 are typically flagged as outliers. This is more reliable than classical z-scores (using mean and SD) because both the center and scale estimates are robust to the very outliers you're trying to detect.

Related Pages