Leave lesson

Statistics · Averages & range

1 / 14

Averages from a frequency table

Mean, median, mode and range from a discrete frequency table — why the mean is the sum of the fx column divided by the total FREQUENCY, not by the number of rows, and how to run it backwards to find a missing frequency.

Statistics · Averages & range

Averages from a frequency table

Mean, median, mode and range from a discrete frequency table — why the mean is the sum of the fx column divided by the total FREQUENCY, not by the number of rows, and how to run it backwards to find a missing frequency.

Why it works

A frequency table is not a new kind of data. It is a compressed list. Somebody wrote down twenty numbers, noticed how much repetition there was, and squashed them onto four lines:
Goals scored, xxFrequency, ff
05
18
24
33
Those four lines stand for the list

0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,3,3,30,\,0,\,0,\,0,\,0,\,1,\,1,\,1,\,1,\,1,\,1,\,1,\,1,\,2,\,2,\,2,\,2,\,3,\,3,\,3

— twenty numbers, in order, with nothing lost. Every average you already know is still the same average of that list; the table just lets you compute it without writing the list out.

The mean. The mean of a list is

mean=total of all the valueshow many values there are.\text{mean} = \frac{\text{total of all the values}}{\text{how many values there are}}.

So you need two numbers, and the table gives you both.

The total of all the values. Five 00s contribute 0×5=00 \times 5 = 0; eight 11s contribute 1×8=81 \times 8 = 8; four 22s contribute 2×4=82 \times 4 = 8; three 33s contribute 3×3=93 \times 3 = 9. Adding: 0+8+8+9=250 + 8 + 8 + 9 = 25 goals in total. That is exactly what the fxfx column is — value ×\times how often it happened, one row at a time — and its total is written fx\sum fx.

How many values there are. Not four. There were twenty matches, and twenty is the total of the frequency column: 5+8+4+3=205 + 8 + 4 + 3 = 20, written f\sum f.

mean=fxf=2520=1.25 goals.\text{mean} = \frac{\sum fx}{\sum f} = \frac{25}{20} = 1.25 \text{ goals}.

The trap, made concrete. The single most common wreck in this topic is dividing by the number of rows:

254=6.25— impossible.\frac{25}{4} = 6.25 \quad \text{— impossible.}

Nobody in that table scored more than 33 goals, so no average of the list can be above 33. The 44 counts how many different values appeared, not how many values there were. Divide the total of 2020 numbers by 44 and you get the mean of a list four numbers long — a list nobody collected.

A second version of the same slip is averaging the xx column on its own: 0+1+2+34=1.5\frac{0 + 1 + 2 + 3}{4} = 1.5. That treats 00, 11, 22 and 33 as equally common. They are not: 11 happened eight times and 33 only three times, so the mean should be dragged down towards 11 — and 1.251.25 is. Two sanity checks worth running every time: the mean must lie between the smallest and largest values, and it must sit nearest the values with the biggest frequencies.

The mode. The mode is the value that happens most often. The biggest number in the frequency column is 88 — but 88 is how often, not what. Look across to the value on that row: the mode is 11 goal. The mode always comes from the xx column; the frequency column only tells you which row to read.

The median. The median is the middle value of the list in order — and the table is already in order, because the rows run from the smallest value to the largest. With n=20n = 20 values the middle sits at position

n+12=212=10.5,\frac{n+1}{2} = \frac{21}{2} = 10.5,

i.e. halfway between the 1010th and the 1111th value. Now count down the frequency column, keeping a running total: positions 1155 are the 00s, positions 661313 are the 11s. Both the 1010th and the 1111th value land inside that second block, so the median is 11. Counting down the frequency column is walking along the list — that is the whole reason it works. What it is not is "the middle row": the middle of four rows would suggest 1.51.5, which counts rows rather than values.

The range. Range is largest value - smallest value, and values live in the xx column: 30=33 - 0 = 3 goals. The frequency column never enters it — 83=58 - 3 = 5 is the spread of the frequencies, which answers a question nobody asked.

Running it backwards. Because the mean is built from fx\sum fx and f\sum f, you can be told the mean and asked for a missing frequency. Call it yy: it appears in both totals, so fxf=mean\frac{\sum fx}{\sum f} = \text{mean} becomes a linear equation in yy. Multiply up, collect the yy terms, solve — then always substitute back and check the mean really comes out.