Hersi Maths WhatsApp me

Understand · explore · practise

Linear interpolation for grouped data

Estimate medians, quartiles and percentiles using cumulative frequency and class boundaries. Explore a manual graph and practise the interpolation formula with worked solutions.

Before you startGrouped data, cumulative frequency and percentile positions.

01 / Estimate a position inside a class

Use the fraction of observations to estimate a fraction of width.

Estimated value = L + ((r − C)/f) × w

L: lower boundary; C: cumulative frequency before the class; f: class frequency; w: class width; r: target cumulative rank.

For percentile p, use r = pn/100. For the median use n/2, and for quartiles n/4 and 3n/4. Keep fractional ranks when interpolating grouped data.

Read a fraction of the class widthExplore
0102040041220Cumulative frequency

Intervals [0,10), [10,20), [20,40) have frequencies 4, 8, 8. Total n = 20.

Rank = 15; class [20,40); fraction = (15 − 12)/8 = 0.375.

Estimate = 20 + 0.375×20 = 27.5.

Straight segments assume observations are spread uniformly within each class. This is an estimate, not recovered raw data.

02 / Locate the target class

Use cumulative counts, not the size of a midpoint.

The target class is the class whose cumulative-frequency interval contains r. For the model, the cumulative counts at upper boundaries 10, 20 and 40 are 4, 12 and 20. A target of 15 lies in the last class.

01 · Find the class

In the model, locate the class used for the median estimate.

Hint

n/2 = 10; locate that cumulative count.

Worked solution

Ten lies between 4 and 12, so use [10,20). Here L = 10, C = 4, f = 8, w = 10.

02 · Fractional target

A grouped dataset contains 30 observations. What target rank estimates Q₁?

Hint

Use n/4 without rounding.

Worked solution

r = 30/4 = 7.5. Do not round it up to eight: that listed-data rank rule is not this interpolation method.

03 / Interpolate within the median class

Subtract the observations before the class.

Estimate the median for the model table.Worked example

r = 20/2 = 10; class [10,20)

Cumulative counts are 4, 12, 20.

(r − C)/f = (10 − 4)/8 = 3/4

The target is three quarters of the way through the class frequency.

Median ≈ 10 + (3/4)×10 = 17.5

Move the same fraction of the class width.

03 · Another median

Classes [0,5), [5,15), [15,20) have frequencies 4, 12, 4. Estimate the median.

Hint

Use r = 10, C = 4 and width 10.

Worked solution

Median ≈ 5 + (10 − 4)/12 × 10 = 10.

04 · Diagnose a formula

Why is 10 + (10/8)×10 wrong for the model median?

Hint

Ten is a cumulative target, not a count within the median class.

Worked solution

Four observations occur before the class. Subtract that cumulative count: use (10 − 4)/8. The wrong fraction exceeds one and incorrectly puts the estimate beyond the class.

04 / Estimate both quarter positions

Use each quartile’s own class width.

Watch: follow the cumulative-frequency segment

Pause, replay or seek freely. The notes explain the same idea and stay in view.

Estimate the quartiles in the model.Worked example

Q₁ target = 5 → [10,20)

Q₁ ≈ 10 + (5 − 4)/8 × 10 = 11.25.

Q₃ target = 15 → [20,40)

Q₃ ≈ 20 + (15 − 12)/8 × 20 = 27.5.

Estimated IQR = 27.5 − 11.25 = 16.25

The two classes have different widths.

05 · Upper quartile

Classes [0,10), [10,30), [30,50) have frequencies 6, 10, 4. Estimate Q₃.

Hint

Target 15 lies in the second class.

Worked solution

Q₃ ≈ 10 + (15 − 6)/10 × 20 = 28.

06 · Class boundary target

In the model, estimate P₆₀.

Hint

The target rank is 12, exactly a cumulative-frequency boundary.

Worked solution

From [10,20): 10 + (12 − 4)/8 × 10 = 20. From [20,40): 20 + (12 − 12)/8 × 20 = 20. The adjacent segments agree.

05 / Use the true class boundaries

A rounded label is not always the boundary.

07 · Rounded measurements

Measurements to the nearest unit have a class labelled 20–29. A percentile target is rank 18; cumulative frequency before this class is 10 and its frequency is 16. Estimate the percentile.

Hint

Use boundaries 19.5 and 29.5, width 10.

Worked solution

19.5 + (18 − 10)/16 × 10 = 24.5 units.

08 · Completed ages

For completed ages 20–29 with the same target and frequencies, what changes?

Hint

Completed ages represent exact ages [20,30).

Worked solution

Use L = 20 and width 10. The estimate is 20 + 8/16 × 10 = 25 years.

06 / Move to other proportions

Percentile and percentage are different quantities.

P₉₀ is a value in the variable’s units; 90 is the target percentage. Interpolation estimates a value. It does not say that the estimated value itself is 90%.

09 · Ninetieth percentile

Find P₉₀ for the model table.

Hint

r = 18, in [20,40).

Worked solution

P₉₀ ≈ 20 + (18 − 12)/8 × 20 = 35.

10 · Count below a value

Using the same straight-segment assumption, estimate the number below x = 15 in the model.

Hint

Halfway across [10,20) means halfway through its eight observations.

Worked solution

Estimated cumulative frequency = 4 + (15 − 10)/10 × 8 = 8. This is a model-based estimate; the grouped counts alone do not give the exact count below 15.

07 / Explain the approximation

Uniformity is a model, not a discovered fact.

The method assumes constant frequency density within the target class. Real observations may cluster near one boundary, so the true percentile can differ. Narrower grouping can preserve more information, but it does not by itself prove uniformity.

11 · An open class

The target percentile falls in “40 or more”. Can you interpolate without further information?

Hint

The class width is missing.

Worked solution

No. A finite upper boundary or an explicit additional model is needed. If the target falls in an earlier bounded class, that earlier interpolation can still be possible when the total count is known.

12 · Empty class

Should you divide by a zero class frequency when interpolating?

Hint

No target strictly inside its cumulative interval exists: the cumulative count is flat.

Worked solution

No. A zero-frequency class contains no observations and cannot contain an interior cumulative target. At a flat boundary, the grouping may leave an interval of possible quantile locations; state the convention or limitation rather than divide by zero.

08 / Locate, subtract, scale and add

Check the estimate stays inside the class.

  1. Calculate the cumulative target r without rounding.
  2. Find the target class and its true boundaries.
  3. Compute the fraction (r − C)/f.
  4. Multiply by the class width and add its lower boundary.
  5. State the estimate, units and uniformity assumption.

Section 1 of 8 · Estimate a position inside a class