Topics / Chapter 2

Organizing raw data

To see at a glance which values occur how often, instead of staring at hundreds of numbers one by one.

What do you see in 100 numbers?

The calculator below is loaded with the midterm scores of 100 students. Looking at the raw list you can hardly see anything: are the scores low or high, is the class split in two, where is the majority?

A frequency table answers these questions at a glance. It counts how many times each value, or each score range, occurs. Once the table is built you immediately see, for example, that scores pile up in the 1–10 and 61–70 ranges while 41–50 is almost empty. That suggests the class is split into two groups, information a single “mean of 50” would hide.

Sample data:

100 numbers read.

Table type

64 distinct values; listing this many values one by one would be unreadable, so they were grouped.

ClassX₀fcfrfcrf
1–105.514140.140.14
11–2015.55190.050.19
21–3025.515340.150.34
31–4035.57410.070.41
41–5045.54450.040.45
51–6055.512570.120.57
61–7065.514710.140.71
71–8075.512830.120.83
81–9085.56890.060.89
91–10095.5111000.111
Total1001

f: frequency, cf: cumulative frequency, rf: relative frequency, crf: cumulative relative frequency, X₀: class midpoint

0510151–10: 14 (14%)1–1011–20: 5 (5%)11–2021–30: 15 (15%)21–3031–40: 7 (7%)31–4041–50: 4 (4%)41–5051–60: 12 (12%)51–6061–70: 14 (14%)61–7071–80: 12 (12%)71–8081–90: 6 (6%)81–9091–100: 11 (11%)91–100Class (points)

Histogram: classes are continuous, so the bars touch.

How was the table built?

  1. First find how wide a range the data covers.

    Range=99−1=98\text{Range} = 99 - 1 = 98
  2. Divide the range by the desired number of classes (10) to estimate the class width.

    Width=Range10=9810=9.8≈10\text{Width} = \dfrac{\text{Range}}{10} = \dfrac{98}{10} = 9.8 \approx 10
  3. The first class starts at 1; each class is 10 units wide. This gives 10 classes.

  4. The class midpoint (X₀) is the mean of the lower and upper limits.

    X0=1+102=5.5X_0 = \dfrac{1 + 10}{2} = 5.5

Mean from grouped data 50.2

Without the raw data, the mean and standard deviation can still be estimated from this table alone. All values in a class are assumed to sit at the class midpoint, so the result differs slightly from the raw-data calculation.

  1. Multiply each class midpoint by its frequency, add them up and divide by n.

    xˉ=∑f⋅X0n\bar{x} = \dfrac{\sum f \cdot X_0}{n}
  2. xˉ=5020100=50.2\bar{x} = \dfrac{5020}{100} = 50.2
  3. s=∑f (X0−xˉ)2n−1=8609199=29.4891s = \sqrt{\dfrac{\sum f\,(X_0 - \bar{x})^2}{n-1}} = \sqrt{\dfrac{86091}{99}} = 29.4891

Simple or grouped?

  • A simple frequency table shows each distinct value on its own row. It is used for data with few distinct values, such as the number of pull-ups (9 rows, from 1 to 9).
  • A grouped frequency table collects values into classes. A 99-row table for scores from 1 to 99 is unreadable; split into 10 classes, the structure appears.

In “Auto” mode the calculator chooses a simple table when there are fewer than 15 distinct values and a grouped table otherwise. You can also change it yourself.

How many classes, how wide?

The method used in the course is this: first find the range the data spans, then divide it by the number of classes you want. The result is the estimated class width and is rounded to an easy-to-read number.

Width=RangeNumber of classes=99−110=9.8≈10\text{Width} = \frac{\text{Range}}{\text{Number of classes}} = \frac{99 - 1}{10} = 9.8 \approx 10

Change the number of classes and watch how the histogram changes. Too few classes hide the structure of the data; too many make the table as scattered as the raw data. Between 5 and 15 usually works well.

Which question does each column answer?

ColumnQuestion it answers
f (frequency)How many students are in this class?
cf (cumulative frequency)How many students in total are in this class or below? “How many scored 30 or less?”
rf (relative frequency)What percentage of students are in this class?
crf (cumulative relative frequency)What percentage of students fell below this value? “What share of the class scored under 50?”

Relative frequency lets you compare groups of different sizes. 6 students failing in a section of 30 and 18 failing in a section of 120 can’t be compared as raw counts; the rates (20% and 15%) can.

Which chart should I draw?

ChartWhen?
Bar chartDiscrete or categorical data: plots per variety, number of pull-ups. Bars have gaps between them.
HistogramContinuous, grouped data: yield, height, score ranges. Bars touch, because one class starts where the previous one ends. The vertical axis always starts at zero.
Frequency polygonA line joining the midpoints of the histogram bars. Handy for comparing two or more distributions on the same chart.
Pie chartFor showing parts of a whole as percentages: how the sown area is split among crops. More than 5–6 slices become unreadable.

Watch out: not starting a histogram’s vertical axis at zero makes small differences look huge. It is the most common way charts in the news mislead.