Variables and Frequency Distributions

You will learn how to count and group numerical data into frequency tables.

Statistics › Tabulation and compilation of Data · 20 min read

In the previous chapter, "How to Classify Data," we looked at how to take a mountain of raw information and sort it into logical groups. We learned how to classify data by attributes—like sorting a population by gender, education level, or employment status.

But what happens when the data we are collecting isn't a descriptive attribute, but a hard number? What if we are recording the exact incomes of 5,000 families, the weights of 500 newborn babies, or the number of rooms in 1,000 different houses?

When we deal with numbers, simple descriptive categories aren't enough. We need a mathematical way to organize these numbers so that they tell a clear story. We need to build a frequency distribution.

This chapter is the bridge between simply sorting data and actually building the formal statistical tables you will use throughout your studies. We are going to learn exactly how to take a chaotic list of raw numbers, figure out what kind of numbers they are, and group them into a clean, readable summary.

What is a Variable?

Before we can group numbers, we need to understand what those numbers represent. In statistics, we are almost always measuring a variable.

Think about a classroom of students. If you record their heights, the height changes from student to student. Height is a variable. If you record their test scores, the scores change from student to student. The test score is a variable.

If a value never changes, it is called a constant (like the number of days in a standard week, which is always seven). Statistics is the study of variables, not constants, because if nothing ever varied, there would be nothing to analyze!

Variables in statistics are broadly divided into two distinct families. Understanding the difference between them is one of the most fundamental skills in data analysis. They are Discrete Variables and Continuous Variables.

The Two Types of Variables

1. Discrete Variables (The "Counting" Variables)

A discrete variable is a number that can only take specific, exact values. It jumps from one value to the next, with impossible gaps in between.

The easiest way to identify a discrete variable is to ask yourself: "Do I count this, or do I measure it?" If you count it, it is discrete.

Let’s look at the number of children in a family. A family might have 1 child, 2 children, or 3 children. A family cannot possibly have 2.4 children or 3.7 children. The variable jumps directly from 1 to 2. There are no valid fractions or decimals in between.

Other examples of discrete variables include:

  • The number of rooms in a house (1, 2, 3, 4...)
  • The number of cars passing through a toll booth in an hour
  • The number of misprints on a page of a book
  • The number of bank accounts a person holds

In all these cases, the values are exact, isolated points.

2. Continuous Variables (The "Measuring" Variables)

A continuous variable is a number that can take any conceivable value within a given range, including any fraction or decimal, no matter how small.

If you measure it using an instrument (like a scale, a ruler, or a thermometer), it is almost certainly continuous.

Let’s look at the weight of a student. A student might weigh 60 kg. But if we use a more precise scale, they might weigh 60.5 kg. An even better scale might show 60.52 kg, and a scientific scale might show 60.5284 kg.

Unlike the number of children, weight does not jump magically from 60 kg to 61 kg. As a person gains weight, they smoothly pass through every single microscopic fraction of a gram between 60 and 61.

Other examples of continuous variables include:

  • The height of a tree (e.g., 15.43 meters)
  • The temperature of a room (e.g., 22.7 degrees Celsius)
  • The time it takes a runner to finish a race (e.g., 12.345 seconds)
  • The exact distance between two cities

What is a Frequency Distribution?

Imagine you are a researcher who has just asked 50 families how many cars they own. You write down the answers on a notepad. Your raw data looks like this: 1, 0, 2, 1, 1, 3, 0, 1, 2, 1, 0, 4, 1, 2... and so on, fifty times.

This is called an ungrouped data array. It is messy, hard to read, and tells you absolutely nothing at a glance. If your boss asks, "What is the most common number of cars owned?", you would have to sit there and manually count the 1s.

To make this data useful, we compress it into a Frequency Distribution.

A frequency distribution is a summary—usually presented as a table—that lists all the possible values of your variable alongside their corresponding frequencies (how many times they occurred).

Building a Discrete Frequency Distribution

When dealing with a discrete variable (like the number of cars), building a frequency distribution is straightforward. We use a tool called Tally Marks.

Tally marks are a fast way of keeping a running count. For every observation in your raw data, you draw a single vertical line (`|`). When you reach the fifth observation for that same value, you draw a diagonal line across the previous four, creating a "bundle" of five. This makes it incredibly easy to count the final total by fives (5, 10, 15, 20...).

Let's convert our car data into a discrete frequency distribution.

Step by step

  1. 1The Tally Process
  2. 2Step 1: Create three columns: "Number of Cars (Variable)", "Tally Marks", and "Frequency (f)".
  3. 3Step 2: List all possible exact values in the first column (0, 1, 2, 3, 4).
  4. 4Step 3: Read through your raw data one number at a time.
  5. 5Step 4: For each number you read, put a single tally mark in the row for that value.
  6. 6Step 5: Once you finish the raw data, count the tally marks in each row and write the final number in the Frequency column.

The resulting table would look something like this:

  • 0 cars: |||| (Frequency: 4)
  • 1 car: |||| |||| |||| || (Frequency: 17)
  • 2 cars: |||| |||| |||| (Frequency: 15)
  • 3 cars: |||| |||| (Frequency: 10)
  • 4 cars: |||| (Frequency: 4)
  • Total Frequency (Σ f): 50

Note: The symbol Σ (Sigma) means "the sum of". So, Σ f means the sum of all frequencies, which must always equal your total number of observations (50 families).

This is a Discrete Frequency Distribution. It is clean, exact, and immediately tells us that owning 1 car is the most common scenario.

Grouped Data: The Continuous Frequency Distribution

The tally method works perfectly for discrete variables because there are only a few exact options (0, 1, 2, 3, 4).

But what if we are dealing with a continuous variable, like the exact weights of 50 students? Your raw data might look like this: 45.2 kg, 47.8 kg, 51.1 kg, 51.9 kg, 62.4 kg...

If you try to make a discrete table for this, you will have a disaster. You would have to create a separate row for 45.2, another row for 47.8, another for 51.1, and so on. Almost every row would have a frequency of exactly 1, because it is very rare for two people to weigh exactly 51.134 kg. Your table would be just as long and useless as your raw data.

To solve this, we group the data into ranges. Instead of asking "How many students weigh exactly 51.1 kg?", we ask, "How many students weigh between 50 kg and 60 kg?"

This is called a Continuous Frequency Distribution (or a Grouped Frequency Distribution).

The Anatomy of a Class

When we group data into ranges, each range is called a Class or a Class Interval. To build and read these tables correctly, you must master the specific vocabulary used to describe these classes.

Let's look at a typical class: "40 - 50"

1. Class Limits

Every class has two boundaries that define it. These are the class limits.

  • Lower Class Limit (L₁): The smallest value that can belong to the class. In our example, L1 is 40.
  • Upper Class Limit (L₂): The largest value that can belong to the class. In our example, L2 is 50.

2. Class Interval (or Class Width / Size)

The class interval is the mathematical difference between the upper limit and the lower limit. It tells you how "wide" the group is. It is usually denoted by the letter i or c.

  • Formula: i = L2 - L1
  • In our example: 50 - 40 = 10. The class width is 10.

3. Class Mark (or Mid-point)

The class mark is the exact center of the class. This is a very important concept because, once data is grouped into a class like 40-50, we lose the original raw numbers. If there are 6 students in the 40-50 class, we no longer know if they weighed 41 kg or 49 kg. For future mathematical calculations (like finding the average), we assume all 6 students sit exactly in the middle of the class.

  • Formula: Class Mark (m) = (L1 + L2) / 2
  • In our example: (40 + 50) / 2 = 90 / 2 = 45. The mid-point is 45.

The Big Trap: Inclusive vs. Exclusive Series

When you create classes for a continuous frequency distribution, you will immediately run into a logical problem.

Imagine your classes are:

  • 10 to 20
  • 20 to 30
  • 30 to 40

You are tallying the data, and you come across a student who scored exactly 20. Where does this student go? Do you put a tally mark in the "10 to 20" class, or in the "20 to 30" class? You cannot put them in both, or you will double-count them.

Statisticians solve this using two different methods of writing classes: the Exclusive Method and the Inclusive Method.

1. The Exclusive Series (The Standard Method)

In an exclusive series, the classes look like this:

  • 0 - 10
  • 10 - 20
  • 20 - 30

Notice that the upper limit of one class (10) is exactly the same as the lower limit of the next class (10).

The Rule: In an exclusive series, the upper limit is excluded from its own class. This means the class "10 - 20" actually contains values from 10 up to 19.999... but it does not include 20. If an observation is exactly 20, it is pushed into the next class (20 - 30).

This is the most mathematically sound way to group continuous variables, and it is the default assumption in statistics.

2. The Inclusive Series

In an inclusive series, the classes look like this:

  • 0 - 9
  • 10 - 19
  • 20 - 29

Notice there is a gap. The first class ends at 9, and the next class begins at 10.

The Rule: In an inclusive series, both the lower limit and the upper limit are included in the class. If an observation is exactly 9, it goes in the first class. If it is exactly 10, it goes in the second class. There is no confusion about where boundary numbers go.

However, inclusive series have a major flaw. Because there is a gap between 9 and 10, what happens if you have a continuous variable with a value of 9.5? It has nowhere to go! It is too big for the first class and too small for the second.

For this reason, inclusive series are generally only used for discrete variables that have been grouped (where fractions like 9.5 don't exist anyway). If you are given an inclusive series for a continuous variable, you must convert it into an exclusive series before doing any serious calculations.

How to Convert Inclusive to Exclusive (Finding True Class Boundaries)

Examiners frequently test your ability to convert an inclusive series into an exclusive one. We do this by finding the True Class Boundaries.

Let's take our inclusive classes:

  • 10 - 19
  • 20 - 29
  • 30 - 39

We need to close the gap between the upper limit of the first class (19) and the lower limit of the second class (20).

Step by step

  1. 1The Conversion Method
  2. 2Step 1: Find the gap. Subtract the upper limit of the first class from the lower limit of the second class (20 - 19 = 1).
  3. 3Step 2: Divide that gap by 2. (1 / 2 = 0.5). This is your adjustment factor.
  4. 4Step 3: Subtract the adjustment factor (0.5) from every Lower Limit.
  5. 5Step 4: Add the adjustment factor (0.5) to every Upper Limit.

Let's apply this:

  • First class (10 - 19): Lower limit becomes 10 - 0.5 = 9.5. Upper limit becomes 19 + 0.5 = 19.5.
  • Second class (20 - 29): Lower limit becomes 20 - 0.5 = 19.5. Upper limit becomes 29 + 0.5 = 29.5.

Our new, converted Exclusive Series is:

  • 9.5 - 19.5
  • 19.5 - 29.5
  • 29.5 - 39.5

The gap is gone! The upper limit of the first class is now identical to the lower limit of the second class. The data is now perfectly continuous.

Worked Example: From Raw Data to a Continuous Table

Let’s put everything together. You are given the raw marks (out of 50) of 20 students in a mathematics exam. The marks are: 12, 44, 23, 35, 18, 29, 41, 33, 27, 15, 48, 39, 22, 31, 19, 45, 26, 37, 14, 28.

Step 1: Decide on the classes. The lowest mark is 12. The highest mark is 48. We need to cover the range from 12 to 48. A logical class interval (width) would be 10. We will use an Exclusive Series starting from 10. Our classes will be: 10-20, 20-30, 30-40, 40-50.

Step 2: Tally the data. We read the raw numbers one by one and place a tally mark in the correct class.

  • 12 goes in 10-20.
  • 44 goes in 40-50.
  • 23 goes in 20-30.
  • ...and so on.

Step 3: Build the final Frequency Distribution Table. Instead of drawing the tally marks here, we will just show the final counted frequencies.

  • Marks: 10 - 20 | Frequency: 4 students
  • Marks: 20 - 30 | Frequency: 6 students
  • Marks: 30 - 40 | Frequency: 6 students
  • Marks: 40 - 50 | Frequency: 4 students
  • Total (Σ f) | 20 students

You have successfully taken a meaningless jumble of 20 numbers and turned it into a clear, analytical table. You can instantly see that most students scored in the middle ranges (20-40), with fewer students at the extreme high and low ends.

This structured table is the foundation for everything that follows in statistics—from drawing histograms to calculating the mean, median, and standard deviation.

Quick Revision

  • Variable: A characteristic that changes from item to item (e.g., height, income).
  • Discrete Variable: Exact, countable numbers with gaps in between (e.g., number of children, shoe size).
  • Continuous Variable: Measurable numbers that can take any fractional value in a range (e.g., weight, time, temperature).
  • Frequency (f): The number of times a specific value or class occurs in the data.
  • Class Limits: The lowest (L1) and highest (L2) values that define a class.
  • Class Interval (i): The width of the class, calculated as Upper Limit minus Lower Limit (L2 - L1).
  • Class Mark (m): The exact midpoint of a class, calculated as (L1 + L2) / 2.
  • Exclusive Series: The upper limit of a class is excluded from that class and pushed to the next (e.g., in 10-20, the number 20 goes to the 20-30 class).
  • Inclusive Series: Both limits are included in the class (e.g., 10-19).
  • Conversion: To convert inclusive to exclusive, find the gap between classes, halve it, subtract it from lower limits, and add it to upper limits.

Related notes