Descriptive Statistics

Data ka spread aur shape samjho — dispersion, skewness aur correlation

📏 Measures of Dispersion

Central tendency (mean, median) ke baad data ka spread measure karna important hai. Do datasets ka mean same ho sakta hai lekin spread alag!

Range

Range = Maximum Value − Minimum Value Simple but affected by extreme values (outliers)

Quartile Deviation (QD)

Q1 = Lower quartile (25th percentile) Q3 = Upper quartile (75th percentile) IQR = Q3 − Q1 (Interquartile Range) QD = IQR/2 = (Q3 − Q1)/2 (Semi-interquartile range)

Mean Deviation (MD)

MD about mean = Σ|xᵢ − x̄| / n [ungrouped] MD about median = Σ|xᵢ − M| / n For grouped data: MD = Σfᵢ|xᵢ − x̄| / Σfᵢ

Standard Deviation (SD) — Most Important!

Variance σ² = Σ(xᵢ − x̄)² / n [ungrouped] SD σ = √Variance Shortcut formula: σ² = Σxᵢ²/n − (x̄)² = (Σxᵢ²/n) − (Σxᵢ/n)² Coefficient of Variation (CV) = (σ/x̄) × 100% (Comparison ke liye — dimensionless)
Example: Data: 4, 7, 2, 9, 3. Find SD.
n=5, Σx = 25, x̄ = 5
Deviations from mean: -1, 2, -3, 4, -2
Squared: 1, 4, 9, 16, 4 → Σ(x−x̄)² = 34
Variance = 34/5 = 6.8
SD = √6.8 = 2.608
MeasureFormulaAdvantageDisadvantage
RangeMax − MinSimple, quickOutlier effect
QD(Q3−Q1)/2Outlier-resistantIgnores 50% data
MDΣ|x−x̄|/nUses all dataNot algebraically tractable
SD√[Σ(x−x̄)²/n]Best measure, algebraically usefulAffected by extreme values

📈 Skewness aur Kurtosis

Distribution ka shape measure karna — symmetric hai ya ek taraf jhuka hua?

Skewness

Positive Skew: Tail right mein (Mean > Median > Mode) Negative Skew: Tail left mein (Mean < Median < Mode) Symmetric: Mean = Median = Mode (Normal distribution) Karl Pearson's Coefficient of Skewness: Sk = 3(Mean − Median) / SD
Skewness Types Negative Skew MeanMedMode Symmetric Mean=Med=Mode Positive Skew ModeMedMean

Kurtosis

Kurtosis = distribution ka peak/flatness measure karta hai Mesokurtic: Normal (kurtosis = 3) Leptokurtic: Sharp peak (kurtosis > 3) — more extreme values Platykurtic: Flat peak (kurtosis < 3) — fewer extreme values

📊 Percentile aur Quartile Rank

Percentile rank of score X = (Number of values below X / Total values) × 100 Quartiles divide data into 4 equal parts: Q1 = 25th percentile, Q2 = 50th (Median), Q3 = 75th Finding Qr: Sort data, position = r(n+1)/4
Example: Scores: 45, 50, 55, 60, 65, 70, 75, 80. Find Q1, Q3.
n=8, sorted already
Q1 position = 1×(8+1)/4 = 2.25 → Q1 = 50 + 0.25×(55-50) = 51.25
Q3 position = 3×(8+1)/4 = 6.75 → Q3 = 70 + 0.75×(75-70) = 73.75
IQR = 73.75 − 51.25 = 22.5

🔗 Correlation

Do variables ka relationship measure karna — jab ek badhta hai toh dusra badhta ya ghatta hai?

Karl Pearson's Coefficient (r)

r = Σ(xᵢ−x̄)(yᵢ−ȳ) / √[Σ(xᵢ−x̄)² × Σ(yᵢ−ȳ)²] = n·Σxy − Σx·Σy / √[(n·Σx² − (Σx)²)(n·Σy² − (Σy)²)] Range: -1 ≤ r ≤ 1 r = +1: Perfect positive, r = -1: Perfect negative r = 0: No linear correlation

Spearman's Rank Correlation (ρ)

ρ = 1 − 6·Σdᵢ² / (n(n²−1)) where dᵢ = difference in ranks of xᵢ and yᵢ Use when data is ordinal or non-normal
Example: x: 2,4,6,8,10 | y: 5,7,8,10,12. Find r.
n=5, x̄=6, ȳ=8.4
Σ(x−x̄)(y−ȳ) = (-4)(-3.4)+(-2)(-1.4)+(0)(-0.4)+(2)(1.6)+(4)(3.6)
= 13.6+2.8+0+3.2+14.4 = 34
Σ(x−x̄)² = 16+4+0+4+16 = 40
Σ(y−ȳ)² = 11.56+1.96+0.16+2.56+12.96 = 29.2
r = 34/√(40×29.2) = 34/√1168 = 34/34.18 ≈ 0.995 (almost perfect positive!)