Skip to content
Tutorials Center
My learning

Topics

Lesson 6 of 37 ยท Collecting and Displaying Data

Frequency Tables and Tally Charts

Organize raw data into tally charts and frequency tables, then add relative and cumulative frequency, grouped class intervals and a Python table builder.

A list of raw observations is hard to read. A frequency table counts how often each value occurs and is the starting point for almost every chart and average in this track. This lesson shows you how to build one by hand and with code.

Tally charts

A tally chart is the quick way to count as you go. You make a stroke for each observation, and group them in fives, four vertical strokes crossed by a fifth, so you can count in fives later. Imagine surveying the number of siblings of 12 students: 1, 0, 2, 1, 1, 3, 0, 2, 1, 2, 1, 4.

Siblings Tally Frequency
0 II 2
1 IIII/ (a bundle of five) 5
2 III 3
3 I 1
4 I 1
Total 12

(Plain text cannot draw the crossing stroke, so IIII/ stands for a bundle of five; on paper you would cross four strokes with a fifth.) Always check that the frequencies add up to the number of observations. That is your built-in error check.

Frequency, relative frequency and percentage

  • Frequency f: how many times a value appears.
  • Relative frequency: f / n, where n is the total number of observations. It is a fraction or decimal, and all relative frequencies add to 1.
  • Percentage frequency: relative frequency times 100.
  • Cumulative frequency: the running total of frequencies. It tells you how many observations are less than or equal to a value.

For the sibling data: 5 of 12 students have exactly one sibling, so the relative frequency of 1 is 5/12, which is about 0.417, or 41.7%.

Python Build a complete frequency table

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check that the last cumulative frequency equals n. If it does not, you missed or double-counted an observation.

Grouped frequency tables

For continuous data, or discrete data with many different values, you group values into class intervals (classes). Each observation goes in exactly one class, so the classes must not overlap and must cover the whole range.

Example: heights in cm, grouped as follows.

Height h (cm) Meaning
140 โ‰ค h < 150 from 140 up to but not including 150
150 โ‰ค h < 160 from 150 up to but not including 160
160 โ‰ค h < 170 and so on

A value of exactly 150 belongs to the second class. Choosing classes of equal width, usually between 5 and 10 classes in total, keeps the picture honest and easy to read. The class width is the upper boundary minus the lower boundary (here 10 cm), and the midpoint is halfway between them (here 145, 155, 165). You will use midpoints later to estimate the mean from grouped data.

Python Group continuous data into classes

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that 150.0 lands in the 150 to 160 class and 159.9 also stays there, while 160.0 starts the next one.

Use the same rule at every boundary: lower limit included, upper limit excluded. Mixing rules in one table causes double counting.

Reading a table

Tables answer questions. Using the sibling table: How many students have two or more siblings? Add the frequencies for 2, 3 and 4: 3 + 1 + 1 = 5. What fraction is that? 5/12. A table also reveals the mode, the value with the highest frequency (one sibling).

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A frequency table for 40 observations has frequencies 8, 12, 15 and x. What is x?

    The frequencies must add to 40. Since 8 + 12 + 15 = 35, x = 5.
  2. 2. In 30 observations, a value has frequency 6. What is its relative frequency?

    Relative frequency = 6 / 30 = 0.2, which is 20%.
  3. 3. In the class 150 โ‰ค h < 160, which height belongs to it?

    The lower limit 150 is included and the upper limit 160 is not.
  4. 4. The cumulative frequency in the last row of a table always equals

    A running total that ends at the last class includes every observation.

Summary

  • Tally charts count as you go in bundles of five; frequencies must add to the total.
  • Relative frequency is f/n; cumulative frequency is the running total.
  • Grouped tables use non-overlapping classes with a clear boundary rule.
  • Midpoints and class widths are used again for histograms and grouped averages.

Next: Bar Charts and Pie Charts