Week 3: Measures of Center & Spread
3182 words
16 min read
2026-09-12T00:00:00.000Z
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
Mean, median, mode, quartiles, IQR, five-number summary, box plots, variance, standard deviation, and the empirical rule. # Statistics for Data Science I — Week 3: Measures of Center & Spread IITM’s Week 3 moves into **numerical data, measures of central tendency, quartiles, and numerical summaries**.

Statistics for Data Science I — Week 3: Measures of Center & Spread
IITM’s Week 3 moves into numerical data, measures of central tendency, quartiles, and numerical summaries.
TL;DR
For numerical data, the main questions become:
and
The highest-value ideas are:
- mean
- median
- mode
- range
- quartiles
- interquartile range
- five-number summary
- outliers
- box plots
- choosing the right summary for symmetric vs skewed data
1. Numerical data recap
Numerical data represents quantities.
Examples:
- height
- age
- income
- marks
- number of purchases
- time taken
Two major types:
2. Why numerical data needs different summaries
For categorical data, counting categories is natural.
For numerical data, there may be many distinct values.
Example:
Listing frequencies alone does not immediately tell us:
- typical value
- spread
- skew
- unusual observations
So we summarize the numerical distribution.
3. Measures of central tendency
A measure of central tendency tries to answer:
What value represents the center or typical location of the data?
The three classic measures are:
4. Arithmetic mean
For observations:
the sample mean is:
or:
5. Example: mean
Data:
Then:
So:
6. Mean as a balance point
The mean has a useful interpretation as the balance point of the data.
If deviations from the mean are:
then:
Positive and negative deviations exactly balance.
7. Why?
Since:
we have:
Therefore:
This property becomes important when variance is introduced.
8. Weighted mean
Sometimes observations do not contribute equally.
Weighted mean:
where:
is the weight attached to value xi.
9. Example: weighted mean
Suppose:
- Quiz score = 80, weight 20%
- Exam score = 90, weight 80%
Then:
So:
Thus:
10. Mean from a frequency table
Suppose value xi occurs fi times.
Then:
This is just a weighted mean where frequency acts as weight.
11. Example
| x | Frequency |
|---|---|
| 1 | 2 |
| 2 | 3 |
| 3 | 1 |
Total observations:
Mean:
12. Median
The median is the middle value after arranging the data in increasing order.
This ordering step is essential.
13. Odd number of observations
If:
is odd, the median is the value at position:
Example:
Here:
Middle position:
So median:
14. Even number of observations
If n is even, median is the average of the two middle values.
Example:
Middle values:
Median:
15. Median as a positional measure
Unlike the mean, the median depends primarily on order, not the exact magnitudes of every value.
This makes it resistant to extreme observations.
16. Example: effect of an outlier
Dataset A:
Mean:
Median:
Now replace 14 with:
Dataset B:
Median remains:
Mean becomes:
So:
17. Mode
The mode is the most frequently occurring value.
Example:
Mode:
18. Multiple modes
Data can have:
- no unique mode
- one mode
- multiple modes
Example:
has modes:
19. Mean vs median vs mode
Mean
Uses every numerical value.
Median
Uses ordered position.
Mode
Uses frequency.
They answer slightly different versions of "typical."
20. When mean is useful
Mean works especially well when the data are roughly symmetric and do not contain severe outliers.
Example:
Mean and median are both around:
21. When median is useful
Median is often preferable for strongly skewed data or data with extreme outliers.
Examples:
- household income
- house prices
- waiting times
A few enormous values can pull the mean upward.
22. Symmetric distributions
For a symmetric unimodal distribution:
In perfectly symmetric idealized cases, they may coincide exactly.
23. Right-skewed distribution
Right skew means a long tail toward larger values.
Typical relationship:
because large observations pull the mean to the right.
Example:
income data.
24. Left-skewed distribution
Left skew means a long tail toward smaller values.
Typical relationship:
because small observations pull the mean leftward.
25. Range
The simplest measure of spread is:
Example:
Range:
26. Weakness of range
Range depends only on two observations:
- minimum
- maximum
So a single extreme value can change it dramatically.
Example:
has range:
Replace 13 with 1000:
27. Percentiles
A percentile indicates a position relative to the distribution.
Informally, the pth percentile is a value such that approximately:
of observations lie at or below it.
Examples:
- 25th percentile
- 50th percentile
- 75th percentile
These are central to quartiles.
28. Quartiles
Quartiles divide ordered data into approximately four parts.
They are:
where:
29. Interpretation
Q1is around the 25th percentile.
is the 50th percentile:
is around the 75th percentile.
30. Important convention warning
There are multiple legitimate conventions for computing quartiles in finite datasets.
Different textbooks/software may differ slightly.
For IITM questions, follow the convention taught in the course/question statement.
The conceptual interpretation remains the same.
31. Simple quartile method
For a basic ordered dataset:
- find median
- lower half → find its median → Q1
- upper half → find its median → Q3
Whether the overall median is included in the halves when n is odd depends on convention.
Again, use IITM's specified method when given.
32. Example
Ordered data:
Median:
Lower half:
So:
Upper half:
So:
33. Interquartile range
The interquartile range measures the spread of the middle 50% of data:
For the previous example:
34. Why IQR is useful
Unlike the range, IQR ignores the most extreme quarter of observations on each side.
So it is more resistant to outliers.
Thus:
is often a strong pair for skewed data.
35. Five-number summary
The five-number summary consists of:
This provides a compact view of:
- center
- spread
- asymmetry
- extremes
36. Example five-number summary
Suppose:
Using the quartiles above:
37. Box plot
A box plot visually represents the quartile structure.
Conceptually:
textmin Q1 median Q3 max |--------[---------|---------]---------|
The box spans:
Its width represents:
The line inside the box marks the median.
38. Outlier rule using IQR
A common descriptive rule identifies potential outliers using fences.
Lower fence:
Upper fence:
Observations outside these fences are often flagged as potential outliers.
39. Example
Suppose:
Then:
Lower fence:
Upper fence:
So a value:
would be flagged as a potential outlier.
40. "Outlier" does not mean "wrong"
An outlier can be:
- genuine rare observation
- measurement error
- data-entry error
- member of another population
- important scientific signal
So do not automatically delete outliers.
The statistical question is:
Why is this value unusual?
41. Shape of a distribution
When describing numerical data, think about:
- center
- spread
- shape
- outliers
A compact framework is:
42. Symmetry
A distribution is roughly symmetric if its left and right sides are mirror-like around the center.
In such cases, mean and median tend to be similar.
43. Skewness
Right-skewed
Longer tail to the right.
Left-skewed
Longer tail to the left.
Important:
skew is named after the tail direction, not where most observations lie.
44. Example: right skew
Data:
Most values are small.
But the tail extends to:
So the data are right-skewed.
The mean is pulled upward.
45. Example: left skew
Data:
Most observations are large, but there is a low extreme tail toward:
So it is left-skewed.
46. Mean and transformations
Suppose every observation is increased by constant c.
Original:
New:
Then:
47. Scaling the mean
If:
then:
More generally:
gives:
48. Median under transformations
For positive scaling:
the median transforms similarly:
This is useful for unit conversions.
49. Example: Celsius to Fahrenheit
Transformation:
If mean Celsius temperature is:
then mean Fahrenheit:
Same linear transformation works on the mean.
50. Combined mean
Suppose Group 1 has:
observations with mean:
Group 2 has:
observations with mean:
Combined mean:
It is a weighted mean.
51. Example
Class A:
Class B:
Combined:
So:
Thus:
Not:
because the classes have different sizes.
52. Mean from deviations
Because:
if you know all but one deviation from the mean, you can recover the missing one.
Example deviations:
Their sum must be zero:
Thus:
53. Why spread matters
Two datasets can have the same mean but behave very differently.
Dataset A:
Dataset B:
Both have mean:
But B is vastly more spread out.
So a measure of center alone is insufficient.
54. Range comparison
Dataset A:
Range:
Dataset B:
Range:
This immediately reveals very different variation.
More sophisticated spread measures come later.
55. Robust/resistant statistics
A statistic is called resistant if extreme values have relatively little effect on it.
Median:
IQR:
Mean:
Range:
This pairing is important.
56. Matching center and spread
For roughly symmetric data without severe outliers:
is often useful.
For skewed data or data with outliers:
is usually more informative.
Standard deviation comes into fuller focus later, but remember this pairing.
57. Histogram intuition
For numerical data, observations can be grouped into intervals called bins.
Example:
textMarks 0–20 ██ 20–40 ████ 40–60 ███████ 60–80 █████ 80–100 ██
A histogram shows the shape of a numerical distribution.
Unlike bar charts, adjacent numerical intervals are continuous, so bars usually touch.
58. Bar chart vs histogram
This distinction is extremely important.
| Bar chart | Histogram |
|---|---|
| categorical data | numerical data |
| separate categories | numerical intervals/bins |
| bars usually separated | bars usually touch |
| order may be arbitrary for nominal data | numerical order is fixed |
Do not confuse them.
59. Bin width matters
Changing histogram bins can make the same data look different.
Too wide:
- hides structure
Too narrow:
- shows excessive noise
So visual summaries depend partly on representation choices.
60. Dot plot intuition
For small numerical datasets, a dot plot may display each observation directly.
Example:
text1: • 2: ••• 3: •• 4: •
This retains more detail than a heavily binned histogram.
Common mistake: finding median without sorting
Data:
Do not choose:
just because it is physically in the middle of the written list.
Sort:
Median:
Common mistake: average always means mean
In ordinary speech, "average" may refer to:
- mean
- median
- sometimes mode
In mathematics/statistics, identify which measure is intended.
If a problem specifically says arithmetic mean, use the formula for mean.
Common mistake: mean must be an observed value
No.
For:
mean:
There need not be an observation equal to the mean.
Common mistake: median must be an observed value
For even n, median may be the average of two middle observations.
So it also need not appear in the dataset.
Example:
median:
Common mistake: mode only works for categorical data
Mode also applies to numerical data.
Example:
Mode:
But mean and median often carry more numerical information.
Common mistake: range describes most observations
No.
Range only looks at:
It tells nothing directly about how the interior values are distributed.
Common mistake: outlier detection is absolute
The:
rule is a conventional screening rule.
It does not prove that a value is erroneous or from another population.
It flags observations for closer inspection.
Common mistake: mean is always best
Consider salaries:
The mean may represent almost nobody.
Median gives a more representative center for the typical observation.
Choose summaries based on distribution shape.
Common mistake: skew direction
If the long tail points right:
even though most observations may be concentrated on the left.
Name the tail, not the cluster.
70. Numerical-data workflow
For a dataset:
text1. Sort / inspect values 2. Identify center ├── mean └── median 3. Identify spread ├── range └── IQR 4. Identify quartiles 5. Look for outliers 6. Describe shape ├── symmetric ├── right-skewed └── left-skewed 7. Choose appropriate summary
71. Formula sheet
Mean
xˉ=n1i=1∑nxiWeighted mean
xˉw=∑wi∑wixiFrequency-table mean
xˉ=∑fi∑fixiRange
max−minMedian position for odd n
2n+1Interquartile range
IQR=Q3−Q1Outlier fences
Q1−1.5IQR Q3+1.5IQR72. Five-number-summary sheet
Always remember the order:
where:
Equalities can occur if the dataset contains repeated values.
73. Week 2 → Week 3 connection
Week 2 categorical data:
Week 3 numerical data:
So the type of variable determines the appropriate statistical summary.
That is the major theme from Weeks 1–3.
74. What you should actually master
By the end of Stats 1 Week 3, you should be able to:
- Calculate arithmetic mean.
- Calculate weighted mean.
- Calculate mean from a frequency table.
- Find median for odd/even sample sizes.
- Find mode.
- Explain how an outlier affects mean vs median.
- Calculate range.
- Interpret percentiles and quartiles.
- Calculate Q1,Q2,Q3 using the course convention.
- Calculate IQR.
- Write a five-number summary.
- Use the 1.5IQR rule for potential outliers.
- Distinguish symmetric, right-skewed, and left-skewed distributions.
- Choose mean vs median appropriately.
- Distinguish a histogram from a categorical bar chart.
If those are comfortable, Stats 1 Week 3 is under control.
Quick Recall & Flashcards
Test your active recall before proceeding to practice problems. Format:
Question :: Answer.- Week 3 Diagnostic: For the dataset [3, 7, 8, 5, 12, 14, 21, 13, 18], what is the median? :: Answer: 12 — Sorted dataset: [3, 5, 7, 8, 12, 13, 14, 18, 21]. With n = 9, the median is the 5th element: 12.
- Week 3 Diagnostic: If a distribution has a third quartile Q3 = 45 and a first quartile Q1 = 25, what is the Interquartile Range (IQR)? :: Answer: 20 — IQR = Q3 - Q1 = 45 - 25 = 20.
Practice & Self-Check
Attempt these diagnostic questions to verify your operational understanding.
1
Question 1
For the dataset [3, 7, 8, 5, 12, 14, 21, 13, 18], what is the median?
NAT
3 Unit Assessment
2
Question 2
If a distribution has a third quartile Q3 = 45 and a first quartile Q1 = 25, what is the Interquartile Range (IQR)?
NAT
3 Unit Assessment