Σ
SDCalc
متوسطالمفاهيم·12 min

الإحصاءات المتينة: MAD والمدى الربيعي والطرق المقاومة للقيم المتطرفة

دليل شامل للإحصاءات المتينة بما في ذلك انحراف الوسيط المطلق (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

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

إيجاد الوسيط

احسب وسيط مجموعة بياناتك.
2

حساب الانحرافات

اطرح الوسيط من كل قيمة وخذ القيم المطلقة.
3

إيجاد MAD

احسب وسيط هذه الانحرافات المطلقة.

تعديل MAD لتقدير σ: للبيانات ذات التوزيع الطبيعي، MAD ≈ 0.6745 × σ. لتقدير الانحراف المعياري من MAD، اضرب في 1.4826:

تقدير SD من MAD

σ̂ = 1.4826 × MAD

لماذا 1.4826؟

هذا المعامل يأتي من العلاقة بين MAD والانحراف المعياري للتوزيعات الطبيعية. يضمن أن MAD المُعدَّل هو مقدر غير متحيز للانحراف المعياري الحقيقي عندما تكون البيانات طبيعية.

المدى الربيعي (IQR)

IQR يقيس انتشار الـ 50% الوسطى من البيانات — المدى بين المئين الخامس والعشرين والمئين الخامس والسبعين:

صيغة IQR

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

يُستخدم IQR على نطاق واسع لأنه بسيط الفهم، سهل التصور في مخططات الصندوق، ويشكّل أساس “قاعدة 1.5×IQR” الشائعة لكشف القيم المتطرفة.

تعديل IQR لتقدير σ: للبيانات الطبيعية، IQR ≈ 1.35 × σ. لتقدير SD من IQR:

تقدير SD من IQR

σ̂ = IQR / 1.35 ≈ 0.7413 × IQR

مقارنة المقاييس المتينة

الانحراف المعياري

يستخدم جميع نقاط البيانات · الأكفأ للبيانات الطبيعية · حساس جدًا للقيم المتطرفة · نقطة الانهيار: 0%

MAD

الأكثر متانة · يستخدم الوسيط (ليس المتوسط) · محصّن ضد أي قيم متطرفة · نقطة الانهيار: 50%

IQR

سهل الفهم · يُستخدم في مخططات الصندوق · يتجاهل الـ 50% المتطرفة · نقطة الانهيار: 25%

متى تستخدم الإحصاءات المتينة

  • التحليل الاستكشافي: عندما لا تعرف ما إذا كانت القيم المتطرفة موجودة، ابدأ بالمقاييس المتينة
  • مشاكل جودة البيانات: عندما قد تحتوي البيانات على أخطاء أو مشاكل في القياس
  • التوزيعات ثقيلة الأطراف: عندما تكون القيم المتطرفة متوقعة (العوائد المالية، مطالبات التأمين)
  • العينات الصغيرة: عندما يكون للقيم المتطرفة تأثير مبالغ فيه بسبب قلة الملاحظات
  • كشف القيم المتطرفة: استخدام SD لكشف القيم المتطرفة أمر دائري؛ استخدم 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.