Σ
SDCalc
בינונייםConcepts·12 min

סטטיסטיקה חסינה: MAD, IQR ושיטות עמידות בפני חריגים

מדריך מקיף לסטטיסטיקה חסינה כולל סטייה מוחלטת חציונית (MAD) וטווח בין-רבעוני (IQR). למדו מתי להשתמש במדדי פיזור עמידים בפני חריגים עם דוגמאות וקוד Python.

למה סטטיסטיקה חסינה?

סטיית תקן היא מדד פיזור רב עוצמה, אך יש לה חולשה קריטית: רגישות קיצונית לחריגים. ערך קיצוני בודד יכול לנפח דרמטית את סט“ת ולתת תמונה מטעה של השתנות אופיינית.

סטטיסטיקה חסינה מספקת מדדי פיזור שעומדים בפני השפעת חריגים, מה שהופך אותם לחיוניים לנתוני עולם אמיתי שבהם שגיאות מדידה, טעויות הזנת נתונים או מקרים קיצוניים אמיתיים שכיחים.

דוגמה: אפקט החריג

נתונים: 10, 12, 11, 13, 12, 11, 100 (חריג אחד) סטיית תקן: 32.4 (נשלטת על ידי החריג) MAD: 1.0 (מתעלמת מהחריג) IQR: 1.5 (מתעלם מהחריג)

נקודת שבירה

“נקודת השבירה” של סטטיסטי היא שיעור הנתונים שיכולים להיות קיצוניים לפני שהסטטיסטי הופך לחסר משמעות. לסט“ת נקודת שבירה של 0% (חריג אחד יכול להרוס אותה). ל-MAD ול-IQR נקודות שבירה של 50% — חצי מהנתונים יכולים להיות חריגים והם עדיין עובדים.

סטייה מוחלטת חציונית (MAD)

MAD הוא מדד הפיזור החסין ביותר. הוא מחשב את החציון של הסטיות המוחלטות מהחציון:

MAD Formula

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

מציאת החציון

חשבו את החציון של מערך הנתונים.
2

חישוב סטיות

חסרו את החציון מכל ערך וקחו ערכים מוחלטים.
3

מציאת MAD

חשבו את החציון של סטיות מוחלטות אלה.

שינוי קנה מידה של MAD לאומדן σ: לנתונים מתפלגים נורמלית, MAD ≈ 0.6745 × σ. כדי לאמוד סט“ת מ-MAD, הכפילו ב-1.4826:

SD Estimate from MAD

σ̂ = 1.4826 × MAD

למה 1.4826?

מקדם שינוי קנה מידה זה נובע מהקשר בין MAD וסט“ת להתפלגויות נורמליות. הוא מבטיח שה-MAD המוקנה הוא אומדן חסר הטיה של סטיית התקן האמיתית כאשר הנתונים נורמליים.

טווח בין-רבעוני (IQR)

IQR מודד את פיזור 50% האמצעיים של הנתונים — הטווח בין האחוזון ה-25 לאחוזון ה-75:

IQR Formula

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

IQR נמצא בשימוש נרחב כי הוא פשוט להבנה, קל להמחשה בתרשימי קופסה, ומהווה את הבסיס לכלל “1.5×IQR” הנפוץ לזיהוי חריגים.

שינוי קנה מידה של IQR לאומדן σ: לנתונים נורמליים, IQR ≈ 1.35 × σ. כדי לאמוד סט“ת מ-IQR:

SD Estimate from IQR

σ̂ = IQR / 1.35 ≈ 0.7413 × IQR

השוואת מדדים חסינים

סטיית תקן

משתמשת בכל נקודות הנתונים · היעילה ביותר לנתונים נורמליים · רגישה מאוד לחריגים · נקודת שבירה: 0%

MAD

המדד החסין ביותר · משתמשת בחציון (לא בממוצע) · חסינה מפני כל חריג · נקודת שבירה: 50%

IQR

קל להבנה · משמש בתרשימי קופסה · מתעלם מ-50% הקיצוניים · נקודת שבירה: 25%

מתי להשתמש בסטטיסטיקה חסינה

  • ניתוח חקרני: כשאינכם יודעים אם קיימים חריגים, התחילו עם מדדים חסינים
  • בעיות איכות נתונים: כשהנתונים עלולים לכלול שגיאות או בעיות מדידה
  • התפלגויות בעלות זנבות כבדים: כשערכים קיצוניים צפויים (תשואות פיננסיות, תביעות ביטוח)
  • מדגמים קטנים: כשלחריגים השפעה גדולה יתר בשל מיעוט תצפיות
  • זיהוי חריגים: שימוש בסט“ת לזיהוי חריגים הוא מעגלי; השתמשו ב-IQR או MAD במקום

דוגמאות מימוש

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.