Descriptive Statistics: Mathematical Illustrations, Numerical
Examples, and Visuals
Prepared for CSE Students
August 23, 2025
1 Types of Data
• Nominal: categorical, no order (e.g., blood type).
• Ordinal: categorical, ordered (e.g., pain level).
• Discrete: countable numbers (e.g., number of logins).
• Continuous: measurable with decimals (e.g., temperature).
2 Measures of Central Tendency
n Pn
1X wi x i
x̄ = xi , x̄w = Pi=1
n
n i=1 wi
i=1
n
Y 1/n n
GM = xi , HM = Pn 1
i=1 i=1 xi
Example (Sepal length, first 10 rows of Iris-setosa): Mean = 4.96, Median = 4.9,
Mode = {4.6, 4.9, 5.0}.
3 Measures of Dispersion
n
1 X
R = xmax − xmin , s2 = (xi − x̄)2
n−1
i=1
√
s= s2 , IQR = Q3 − Q1
Example: Range = 1.0, Sample SD ≈ 0.310, IQR = 0.4.
4 Shape of Distribution
1 Pn 1 Pn
n i=1 (xi − x̄)3 n i=1 (xi − x̄)4
Skewness = , Kurtosis =
s3 s4
Interpretation: Skewness > 0 ⇒ right skew. Skewness < 0 ⇒ left skew.
1
5 Bivariate Analysis
n
1 X Cov(X, Y )
Cov(X, Y ) = (xi − x̄)(yi − ȳ), rxy =
n−1 sx sy
i=1
Example (Sepal length vs Petal length, n = 10): r ≈ 0.77 (strong positive correlation).
[Link]
6 Five-number Summary
{Min, Q1 , Median, Q3 , Max}
Whiskers extend to [Q1 − 1.5 · IQR, Q3 + 1.5 · IQR].
Example (Sepal width, n = 10): Min = 2.9, Q1 = 3.1, Median = 3.3, Q3 = 3.5, Max
= 3.9.
2
[Link]
7 Histograms
Divide data range [a, b] into k bins (width h = (b − a)/k). Bin frequency fj , proportion
pj = fj /n.
[Link]
3
8 Correlation Matrix & Heatmap
For p variables X1 , . . . , Xp , the correlation matrix is
1 r12 ··· r1p
r21 1 ··· r2p
R= .
.. .. ..
.. . . .
rp1 rp2 · · · 1
9 Proportions Bar Chart
fi
pi = Pk
j=1 fj
Example (Iris dataset): Setosa = 33.3%, Versicolor = 33.3%, Virginica = 33.3%.
Appendix: Sample Iris Dataset (first 10 rows)
Obs Sepal Length Sepal Width Petal Length Petal Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3.0 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5.0 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
7 4.6 3.4 1.4 0.3 setosa
8 5.0 3.4 1.5 0.2 setosa
9 4.4 2.9 1.4 0.2 setosa
10 4.9 3.1 1.5 0.1 setosa