Σ
SDCalc
KatamtamanMga Konsepto·12 min

Robust Statistics: MAD, IQR, at Mga Paraan na Lumalaban sa Outliers

Kumpletong gabay sa robust statistics kabilang ang Median Absolute Deviation (MAD) at Interquartile Range (IQR). Matutunan kung kailan gamitin ang outlier-resistant measures ng spread na may mga halimbawa at Python code.

Bakit Robust Statistics?

Ang standard deviation ay isang makapangyarihang sukatan ng pagkakalat, ngunit mayroon itong kritikal na kahinaan: matinding sensitivity sa outliers. Ang isang extreme na halaga ay maaaring dramatikong magpalaki sa SD, na nagbibigay ng nakakalitong larawan ng tipikal na variation.

Nagbibigay ang robust statistics ng mga sukatan ng pagkakalat na lumalaban sa impluwensya ng outliers, kaya naman ito ay mahalaga para sa real-world data kung saan ang mga pagkakamali sa pagsukat, pagkakamali sa data entry, o tunay na extreme cases ay karaniwan.

Halimbawa: Ang Epekto ng Outlier

Data: 10, 12, 11, 13, 12, 11, 100 (isang outlier) Standard Deviation: 32.4 (dinomina ng outlier) MAD: 1.0 (binalewala ang outlier) IQR: 1.5 (binalewala ang outlier)

Breakdown Point

Ang “breakdown point” ng isang statistic ay ang proporsyon ng data na maaaring maging extreme bago mawalan ng kahulugan ang statistic. Ang SD ay may breakdown point na 0% (isang outlier ay maaaring sirain ito). Ang MAD at IQR ay may breakdown points na 50%—kalahati ng iyong data ay maaaring outliers at gumagana pa rin ang mga ito.

Median Absolute Deviation (MAD)

Ang MAD ang pinaka-robust na sukatan ng pagkakalat. Kinakalkula nito ang median ng absolute deviations mula sa median:

MAD Formula

MAD = median(|xᵢ - median(x)|)
1

Hanapin ang Median

Kalkulahin ang median ng iyong dataset.
2

Kalkulahin ang mga Deviation

Ibawas ang median mula sa bawat halaga at kunin ang absolute values.
3

Hanapin ang MAD

Kalkulahin ang median ng mga absolute deviations na ito.

Pag-scale ng MAD upang tantiyahin ang σ: Para sa normally distributed data, MAD ≈ 0.6745 × σ. Upang tantiyahin ang SD mula sa MAD, i-multiply sa 1.4826:

SD Estimate from MAD

σ̂ = 1.4826 × MAD

Bakit 1.4826?

Ang scaling factor na ito ay nagmumula sa relasyon ng MAD at SD para sa normal distributions. Tinitiyak nito na ang scaled MAD ay isang unbiased estimator ng tunay na standard deviation kapag normal ang data.

Interquartile Range (IQR)

Sinusukat ng IQR ang pagkakalat ng gitnang 50% ng data—ang range sa pagitan ng ika-25 at ika-75 percentiles:

IQR Formula

IQR = Q3 - Q1 = ika-75 percentile - ika-25 percentile

Malawakang ginagamit ang IQR dahil simple itong maunawaan, madaling i-visualize sa box plots, at ito ang batayan ng karaniwang “1.5×IQR rule” para sa outlier detection.

Pag-scale ng IQR upang tantiyahin ang σ: Para sa normal data, IQR ≈ 1.35 × σ. Upang tantiyahin ang SD mula sa IQR:

SD Estimate from IQR

σ̂ = IQR / 1.35 ≈ 0.7413 × IQR

Paghahambing ng Robust Measures

Standard Deviation

Gumagamit ng lahat ng data points · Pinaka-efficient para sa normal data · Napaka-sensitive sa outliers · Breakdown point: 0%

MAD

Pinaka-robust na sukatan · Gumagamit ng median (hindi mean) · Hindi apektado ng anumang outliers · Breakdown point: 50%

IQR

Madaling maunawaan · Ginagamit sa box plots · Hindi pinapansin ang extreme 50% · Breakdown point: 25%

Kailan Gamitin ang Robust Statistics

  • Exploratory analysis: Kapag hindi mo alam kung may outliers, magsimula sa robust measures
  • Mga isyu sa kalidad ng data: Kapag maaaring may mga error o problema sa pagsukat ang data
  • Heavy-tailed distributions: Kapag inaasahan ang mga extreme values (financial returns, insurance claims)
  • Maliliit na samples: Kapag ang outliers ay may sobrang malaking epekto dahil sa kakaunting obserbasyon
  • Outlier detection: Ang paggamit ng SD upang matukoy ang outliers ay circular; gamitin ang IQR o MAD sa halip

Mga Halimbawa ng Implementation

Python
import numpy as np
from scipy import stats

def mad(data):
    """Median Absolute Deviation"""
    median = np.median(data)
    return np.median(np.abs(data - median))

def scaled_mad(data):
    """MAD scaled to estimate SD (for normal data)"""
    return 1.4826 * mad(data)

def iqr(data):
    """Interquartile Range"""
    return np.percentile(data, 75) - np.percentile(data, 25)

# Compare on data with outlier
data = [10, 12, 11, 13, 12, 11, 100]
print(f"SD: {np.std(data, ddof=1):.2f}")
print(f"MAD: {mad(data):.2f}")
print(f"Scaled MAD: {scaled_mad(data):.2f}")
print(f"IQR: {iqr(data):.2f}")

Further Reading

How to Read This Article

A statistics tutorial is a practical interpretation guide, not just a formula dump. It refers to the assumptions, notation, and reporting language that analysts need when they explain a result to a teacher, manager, client, or reviewer. The article body covers the specific topic, while the sections below create a common interpretation frame that readers can reuse across related metrics.

Reading goalWhat to focus onCommon mistake
DefinitionWhat the metric is and what quantity it summarizesTreating the formula as self-explanatory
Formula choiceSample versus population assumptions and notationUsing n when n-1 is required or vice versa
InterpretationWhether the result indicates concentration, spread, or riskCalling a large value good or bad without context

Frequently Asked Questions

How should I interpret a high standard deviation?

A high standard deviation means the observations are spread farther from the mean on average. Whether that spread is acceptable depends on the context: wide dispersion might signal risk in finance, instability in manufacturing, or genuine natural variation in scientific data.

Why do some articles mention n while others mention n-1?

The denominator reflects the difference between population and sample formulas. Population variance and population standard deviation use N because the full dataset is known. Sample variance and sample standard deviation often use n-1 because Bessel’s correction reduces bias when estimating population spread from a sample.

What is a statistical interpretation guide?

A statistical interpretation guide is a page that moves beyond arithmetic and explains meaning. It tells you what a metric is, when the formula applies, and how to describe the result in plain English without overstating certainty.

Can I cite this article in a report?

You should cite the underlying authoritative reference for formal work whenever possible. This page is best used as an explanatory bridge that helps you understand the concept before quoting the original standard or handbook.

Why include direct citations on every article page?

Direct citations give readers a route to verify the definition, notation, and assumptions. That improves trust and reduces the chance that a simplified explanation is mistaken for the entire technical standard.

Authoritative References

These sources define the concepts referenced most often across our articles. Bessel's correction is a sample adjustment, variance is a squared measure of spread, and standard deviation is the square root of variance expressed in the same units as the data.