Aver­ag­ing when the details are lost

Very often data reaches you already grouped into class inter­vals, like marks 00–1010, 1010–2020 and so on. Once that hap­pens, the indi­vid­ual val­ues are gone, and you can't add them up directly. So we esti­mate the mean by pre­tend­ing every value in a class sits right at the mid­dle of it, the class mark. In this les­son you'll meet three ways to organ­ise that cal­cu­la­tion: the direct method, the assumed-mean method and the step-devi­a­tion method. All three give exactly the same answer. The only dif­fer­ence is how much arith­metic each one asks of you.

Class mark

The class mark xix_i of a class is the mid­point of its lim­its:

xi=lower limit+upper limit2\displaystyle x_i = \frac{\text{lower limit} + \text{upper limit}}{2}

So for the class 2020–3030, xi=25x_i = 25, and we treat every obser­va­tion in that class as if it were 2525.

Direct method

xˉ=∑fixi∑fi\displaystyle \bar{x} = \frac{\sum f_i x_i}{\sum f_i}

In words: mul­ti­ply each class mark by its fre­quency, add up the prod­ucts, and divide by the total fre­quency.

Exam­ple 1. Here are the daily wages of 4040 work­ers at a small work­shop:

Wages (₹) 100100–120120 120120–140140 140140–160160 160160–180180 180180–200200
Work­ers 66 1010 1313 77 44
xix_i 110110 130130 150150 170170 190190
fixif_i x_i 660660 13001300 19501950 11901190 760760

Adding up, ∑fi=40\displaystyle \sum f_i = 40 and ∑fixi=5860\displaystyle \sum f_i x_i = 5860. So xˉ=586040=146.5\displaystyle \bar{x} = \frac{5860}{40} = 146.5, and the mean wage is ₹146.50146.50.

Histogram of daily wages of 40 workers in classes 100–120 to 180–200 with frequencies 6, 10, 13, 7 and 4; class marks are dotted and a dashed line marks the mean 146.5.
Exam­ple 1: the wage data, with the mean at 146.5

Assumed-mean method

Big class marks lead to big, clumsy prod­ucts. To keep the num­bers small, pick a handy class mark aa (usu­ally the one in the mid­dle) and work with the devi­a­tions di=xi−ad_i = x_i - a instead:

xˉ=a+∑fidi∑fi\displaystyle \bar{x} = a + \frac{\sum f_i d_i}{\sum f_i}

Exam­ple 2. Let's redo the same data with a=150a = 150.

xix_i 110110 130130 150150 170170 190190
did_i −40-40 −20-20 00 2020 4040
fidif_i d_i −240-240 −200-200 00 140140 160160

Now ∑fidi=−140\displaystyle \sum f_i d_i = -140, so xˉ=150+−14040=150−3.5=146.5\displaystyle \bar{x} = 150 + \frac{-140}{40} = 150 - 3.5 = 146.5. The same answer, with much friend­lier num­bers.

Step-devi­a­tion method

If all the classes have the same width hh, then every did_i is a mul­ti­ple of hh. So divide it out: ui=xi−ah\displaystyle u_i = \frac{x_i - a}{h}. Now the uiu_i are tiny whole num­bers, …,−2,−1,0,1,2,…\ldots, -2, -1, 0, 1, 2, \ldots

Number line of class marks 110, 130, 150, 170, 190 with assumed mean 150; below each, the deviation from 150 (−40 to 40) and the step count of 20 (−2 to 2).
Devi­a­tions from a = 150 shrink to steps of h = 20

xˉ=a+h×∑fiui∑fi\displaystyle \bar{x} = a + h \times \frac{\sum f_i u_i}{\sum f_i}

Exam­ple 3. One more time with the same data, tak­ing a=150a = 150 and h=20h = 20.

uiu_i −2-2 −1-1 00 11 22
fiuif_i u_i −12-12 −10-10 00 77 88

This time ∑fiui=−7\displaystyle \sum f_i u_i = -7, so xˉ=150+20×−740=150−3.5=146.5\displaystyle \bar{x} = 150 + 20 \times \frac{-7}{40} = 150 - 3.5 = 146.5. Third time, same answer.

A word of warn­ing: mul­ti­ply­ing by hh at the end is the step stu­dents for­get most often. If your step-devi­a­tion answer sits sus­pi­ciously close to aa, within a frac­tion of a class width, even though the devi­a­tions were clearly big­ger, check whether you left it out.

Choos­ing a method

  • Small class marks and small fre­quen­cies: use the direct method.
  • Large class marks with unequal widths: use the assumed mean.
  • Equal widths: use step devi­a­tion, which needs the least arith­metic.

Worked exam­ple with a miss­ing fre­quency

Exam­ple 4. The mean of the data below is 2727. Find the miss­ing fre­quency pp.

Class 00–1010 1010–2020 2020–3030 3030–4040 4040–5050
Fre­quency 88 pp 1212 1313 1010

The class marks are 5,15,25,35,455, 15, 25, 35, 45. Then ∑fi=43+p\displaystyle \sum f_i = 43 + p and ∑fixi=40+15p+300+455+450=1245+15p\displaystyle \sum f_i x_i = 40 + 15p + 300 + 455 + 450 = 1245 + 15p. Set the mean equal to what we are told:

1245+15p43+p=27⟹1245+15p=1161+27p⟹12p=84⟹p=7\displaystyle \frac{1245 + 15p}{43 + p} = 27 \quad \Longrightarrow \quad 1245 + 15p = 1161 + 27p \quad \Longrightarrow \quad 12p = 84 \quad \Longrightarrow \quad p = 7

Prac­tice

  1. Use the direct method to find the mean.
Class 00–2020 2020–4040 4040–6060 6060–8080 8080–100100
Fre­quency 55 99 1212 88 66
  1. Use the assumed-mean method, with a=35a = 35, to find the mean.
Class 1010–2020 2020–3030 3030–4040 4040–5050 5050–6060
Fre­quency 44 77 1111 55 33
  1. Use the step-devi­a­tion method to find the mean.
Class 100100–150150 150150–200200 200200–250250 250250–300300 300300–350350 350350–400400
Fre­quency 44 66 1414 1010 44 22
  1. The mean of this dis­tri­b­u­tion is 19.419.4. Find qq.
Class 1010–1414 1414–1818 1818–2222 2222–2626 2626–3030
Fre­quency 66 99 qq 77 44

Answers

Show answers
  1. The class marks are 10,30,50,70,9010, 30, 50, 70, 90. Then ∑fixi=50+270+600+560+540=2020\displaystyle \sum f_i x_i = 50 + 270 + 600 + 560 + 540 = 2020 and ∑fi=40\displaystyle \sum f_i = 40, so the mean is 50.550.5.
  2. The devi­a­tions are di=−20,−10,0,10,20d_i = -20, -10, 0, 10, 20. Then ∑fidi=−80−70+0+50+60=−40\displaystyle \sum f_i d_i = -80 - 70 + 0 + 50 + 60 = -40 and ∑fi=30\displaystyle \sum f_i = 30, so the mean is 35−4030=33.67\displaystyle 35 - \frac{40}{30} = 33.67.
  3. Take a=225a = 225 and h=50h = 50, so ui=−2,−1,0,1,2,3u_i = -2, -1, 0, 1, 2, 3. Then ∑fiui=−8−6+0+10+8+6=10\displaystyle \sum f_i u_i = -8 - 6 + 0 + 10 + 8 + 6 = 10 and ∑fi=40\displaystyle \sum f_i = 40, so the mean is 225+50×1040=237.5\displaystyle 225 + 50 \times \frac{10}{40} = 237.5.
  4. The class marks are 12,16,20,24,2812, 16, 20, 24, 28. So 72+144+20q+168+11226+q=19.4\displaystyle \frac{72 + 144 + 20q + 168 + 112}{26 + q} = 19.4, which gives 496+20q=504.4+19.4q496 + 20q = 504.4 + 19.4q, then 0.6q=8.40.6q = 8.4, and q=14q = 14.