CATEGORICAL VS QUANTITATIVE VARIABLES IN STATISTICS: THE STICKER, LADDER AND RULER METHOD
Nominal, Ordinal, Discrete and Continuous Variables Explained With Frequency Tables, Relative Frequency, Two-Way Tables and Worked Examples
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE 30-SECOND ANSWER: WHAT TYPE OF VARIABLE ARE YOU LOOKING AT?
Imagine looking at a spreadsheet containing the following information:
Favourite drink: Coffee
Shirt size: Medium
Number of children: 2
Waiting time: 4.5 minutes
Customer postcode: 90210
They all describe something about a person. But they are not all the same type of statistical data.
In statistics, variables generally fall into two major groups:
1. Categorical variables (qualitative data)
These identify groups, classes or labels.
Examples include eye colour, favourite food, country, school grade and blood group.
Categorical variables have two common types:
Nominal: Categories without a natural order.
Ordinal: Categories with a meaningful order.
2. Quantitative variables (numerical data)
These represent quantities that are counted or measured.
Examples include height, income, temperature, distance and number of siblings.
Quantitative variables have two common types:
Discrete: Values that can be counted.
Continuous: Values that can be measured across a range.
Here is the entire classification in one place:
CATEGORICAL
Nominal: Names without order.
Ordinal: Categories with order.
QUANTITATIVE
Discrete: Counted values.
Continuous: Measured values.
The simplest memory trick is:
Sticker = Nominal
Ladder = Ordinal
Ruler = Quantitative
Let's see why this works and how it helps you solve statistics questions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE ZIP CODE MISTAKE: WHY A NUMBER IS NOT ALWAYS QUANTITATIVE DATA
Consider two customers:
Customer A: ZIP code 90210
Customer B: ZIP code 10001
Someone enters both values into a spreadsheet and calculates their average:
(90210 + 10001) ÷ 2 = 50105.5
The calculation is mathematically correct.
But what does ZIP code 50105.5 actually tell us?
Nothing useful.
A ZIP code identifies a geographical delivery area. Its digits are labels, not measurements.
The same problem occurs with telephone numbers, customer identification numbers, employee IDs and football shirt numbers.
In the UK, postcodes such as M1 1AE make the problem even more obvious because they contain letters.
This gives us an important statistical lesson:
A variable does not become quantitative simply because its values contain digits.
The meaning of the numbers matters more than their appearance.
A customer ID of 105 is not necessarily greater than customer ID 104 in any meaningful statistical sense.
A shirt number of 10 is not twice a shirt number of 5.
But a height of 180 cm is genuinely greater than a height of 90 cm.
Before performing calculations, always ask:
Are these numbers measuring something, or are they simply identifying something?
This question prevents many mistakes in introductory statistics, AP Statistics, GCSE Mathematics and A-level statistics.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE RUNNING EXAMPLE: A COFFEE STALL WITH 20 CUSTOMERS
Throughout this article, we will use one small dataset to understand statistical variables, frequency distributions, relative frequency tables and two-way tables.
A coffee stall at a Saturday market records information about 20 customers.
Each row represents one customer.
Each column represents a variable.
| No. | Drink | Size | Satisfaction | Wait (min) | Pastries | Service |
|---|---|---|---|---|---|---|
| 1 | Latte | M | 4 | 3.2 | 1 | Eat in |
| 2 | Tea | S | 3 | 1.5 | 0 | Eat in |
| 3 | Flat white | L | 1 | 5.0 | 2 | Take away |
| 4 | Latte | M | 4 | 2.4 | 1 | Take away |
| 5 | Hot chocolate | M | 5 | 4.1 | 0 | Eat in |
| 6 | Tea | S | 4 | 0.8 | 1 | Eat in |
| 7 | Latte | L | 2 | 6.3 | 3 | Take away |
| 8 | Flat white | M | 4 | 2.9 | 1 | Eat in |
| 9 | Tea | S | 3 | 1.9 | 0 | Eat in |
| 10 | Latte | M | 5 | 3.8 | 2 | Eat in |
| 11 | Hot chocolate | L | 2 | 4.8 | 0 | Take away |
| 12 | Latte | M | 4 | 2.1 | 1 | Take away |
| 13 | Tea | L | 3 | 7.1 | 2 | Take away |
| 14 | Flat white | M | 4 | 3.0 | 1 | Take away |
| 15 | Latte | S | 5 | 1.2 | 0 | Eat in |
| 16 | Tea | M | 4 | 2.6 | 1 | Eat in |
| 17 | Hot chocolate | L | 3 | 5.5 | 3 | Eat in |
| 18 | Latte | M | 4 | 3.5 | 2 | Take away |
| 19 | Tea | S | 5 | 1.7 | 0 | Eat in |
| 20 | Flat white | L | 3 | 4.4 | 1 | Take away |
Satisfaction is scored from 1 (very unhappy) to 5 (very happy).
Notice something interesting: the spreadsheet contains words, numbers, measurements and identification codes.
They cannot all be analysed in the same way.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 1: WHAT IS A VARIABLE IN STATISTICS?
A variable is a characteristic or feature that can take different values for different individuals or observations.
For example:
A student's height can vary.
A customer's preferred drink can vary.
The number of books owned by a student can vary.
The time taken to finish an examination can vary.
If every student in a group had exactly the same height, height would be constant within that group rather than varying.
In a statistical dataset, the individuals being studied are called observational units.
The characteristics recorded about them are variables.
For example, in our coffee-stall dataset:
Observational unit: One customer.
Variables: Drink, size, satisfaction, waiting time, pastries purchased and service type.
Sample size: 20 customers.
Understanding the difference between an observation, an individual and a variable is important when reading statistical tables.
Categorical variables
Categorical variables, also called qualitative variables, describe qualities, identities or groups.
Examples:
Eye colour
Nationality
Favourite sport
Type of vehicle
Blood group
Educational qualification
Payment method
You can count how many observations belong to each category.
You can calculate percentages and identify the most common category.
However, adding the category names together does not produce a meaningful quantity.
Quantitative variables
Quantitative variables, also called numerical variables, represent amounts.
Examples:
Height in centimetres
Weight in kilograms
Monthly salary
Number of children
Examination marks
Waiting time in minutes
Distance travelled
These values can be used for appropriate mathematical calculations.
For example, the average waiting time of a group of customers is meaningful.
The average favourite drink is not.
Classifying the coffee-stall variables
| Variable | Classification |
|---|---|
| Drink | Categorical, nominal |
| Size | Categorical, ordinal |
| Satisfaction score | Categorical, ordinal |
| Waiting time | Quantitative, continuous |
| Pastries purchased | Quantitative, discrete |
| Service type | Categorical, nominal |
| Customer number | Identification label |
One important detail: a satisfaction rating from 1 to 5 is normally treated as ordinal when each rating represents an ordered response category. Some statistical analyses treat such scores as approximately numerical, but that requires an additional assumption.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 2: THE STICKER, LADDER AND RULER METHOD
Most introductory statistics textbooks explain variable types using definitions.
Here is a more memorable way to identify them.
1. THE STICKER: NOMINAL VARIABLES
Imagine three jars.
One has a sticker saying LATTE.
Another says TEA.
The third says FLAT WHITE.
You can rearrange the jars in any order without changing their meaning.
There is no natural statistical ranking between the three drinks.
That is a nominal variable.
Examples:
Eye colour: brown, blue, green.
Blood group: A, B, AB, O.
Favourite subject: mathematics, science, history.
Car manufacturer: Toyota, Ford, Honda.
Country: India, USA, UK.
Payment method: cash, card, digital payment.
ZIP code and postcode.
Telephone number.
The important feature is that the categories are names, not ordered measurements.
Sticker rule: If the categories can be rearranged without losing meaningful information, think nominal.
2. THE LADDER: ORDINAL VARIABLES
Now imagine a ladder.
The bottom rung is SMALL.
The middle rung is MEDIUM.
The top rung is LARGE.
The order matters.
You cannot randomly rearrange these categories without losing information.
However, you do not necessarily know the exact difference between the rungs.
That is an ordinal variable.
Examples:
Small, medium, large.
Poor, satisfactory, good, excellent.
Strongly disagree to strongly agree.
Bronze, silver, gold.
First, second, third place.
GCSE grade categories.
Educational qualification levels.
Hotel star ratings.
Ordinal variables tell us which category ranks higher or lower.
They do not automatically tell us how far apart the categories are.
For example, the difference between a one-star and two-star rating is not necessarily equal to the difference between a four-star and five-star rating.
Ladder rule: If order matters but equal gaps cannot be assumed, think ordinal.
3. THE RULER: QUANTITATIVE VARIABLES
A ruler has equally spaced measurement marks.
The difference between 2 cm and 3 cm is the same as the difference between 8 cm and 9 cm.
Quantitative variables represent numerical quantities where the measurement scale supports meaningful numerical operations.
Examples:
Height
Weight
Distance
Income
Age
Waiting time
Number of books
Number of customers
For example:
A person who waits 10 minutes has waited twice as long as someone who waits 5 minutes.
The numerical difference is meaningful.
However, not every quantitative scale supports every type of comparison. Celsius temperature has meaningful differences, but 20°C is not twice as hot as 10°C.
Ruler rule: If the numbers represent genuine quantities with meaningful numerical differences, think quantitative.
THE THREE-QUESTION CLASSIFICATION TEST
Whenever you encounter a variable, ask:
Are the values labels or genuine quantities?
If they are labels, do they have a natural order?
If they are quantities, are they counted or measured?
Your answer gives the classification:
| Question | Answer | Variable type |
|---|---|---|
| Labels without order | Yes | Nominal |
| Labels with order | Yes | Ordinal |
| Counted quantity | Yes | Discrete |
| Measured quantity | Yes | Continuous |
This method is particularly useful for AP Statistics multiple-choice questions and GCSE or A-level data-classification exercises.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 3: THE FOUR MAIN TYPES OF STATISTICAL VARIABLES
A. NOMINAL DATA: CATEGORIES WITHOUT ORDER
Nominal data represents distinct categories that do not have an inherent ranking.
Examples include:
Blood group
Hair colour
Favourite football team
Type of smartphone
Country of residence
Postal code
Vehicle registration number
Yes/no survey responses
A nominal variable can contain only two categories.
Such a variable is called binary or dichotomous.
For example:
Pass / Fail
Yes / No
Employed / Unemployed
You can calculate the frequency and percentage of each category.
You can also identify the mode, meaning the most frequently occurring category.
In our coffee-stall example:
| Drink | Frequency |
|---|---|
| Latte | 7 |
| Tea | 6 |
| Flat white | 4 |
| Hot chocolate | 3 |
| Total | 20 |
Latte is the modal category because it occurs most frequently.
B. ORDINAL DATA: CATEGORIES WITH ORDER
Ordinal data contains categories that can be arranged meaningfully.
Examples:
Customer satisfaction ratings.
Educational achievement levels.
Competition rankings.
Income brackets.
Product quality ratings.
Agreement scales.
Consider the following satisfaction categories:
Very unhappy → Unhappy → Neutral → Happy → Very happy
We can identify the most common category.
We can also identify a median category when the observations are ordered.
In our dataset, drink sizes have the following frequencies:
| Size | Frequency |
|---|---|
| Small | 5 |
| Medium | 9 |
| Large | 6 |
| Total | 20 |
The 10th and 11th observations in the ordered list are both Medium.
Therefore, the median drink size is Medium.
Ordinal data is particularly useful when summarising survey responses, customer feedback and rating scales.
THE IMPORTANT LIKERT SCALE QUESTION: IS A 1–5 RATING ORDINAL OR QUANTITATIVE?
This is a common question in statistics and research methods.
Suppose a customer answers:
1 = Very dissatisfied
2 = Dissatisfied
3 = Neutral
4 = Satisfied
5 = Very satisfied
The responses are ordered.
But can we prove that the difference between 1 and 2 is identical to the difference between 4 and 5?
No.
Therefore, a single five-point satisfaction item is most safely classified as ordinal.
However, researchers sometimes calculate the mean of rating responses, especially when combining several related questions into a composite score.
For our coffee stall:
Total satisfaction score = 72
Number of customers = 20
Mean satisfaction score = 72 ÷ 20 = 3.6
The median satisfaction score is 4.
Both calculations can be reported, but the interpretation must acknowledge that a single Likert-type item is ordinal.
For school examinations, follow the classification and calculation method specified in the question.
C. DISCRETE QUANTITATIVE DATA: VALUES THAT CAN BE COUNTED
Discrete quantitative variables have countable possible values.
Examples:
Number of siblings.
Number of children.
Number of cars owned.
Goals scored in a match.
Number of emails received.
Defects in a production batch.
Number of books on a shelf.
For example, a household might have:
0, 1, 2, 3 or 4 children.
It cannot have 2.5 children as an actual count.
Discrete variables can have a finite number of possible values or a countably infinite set of possible values.
D. CONTINUOUS QUANTITATIVE DATA: VALUES THAT CAN BE MEASURED
Continuous variables can take any possible value within a range, depending on the precision of measurement.
Examples:
Height
Weight
Temperature
Time
Distance
Speed
Volume
Length
A waiting time might be:
3 minutes
3.2 minutes
3.25 minutes
3.257 minutes
The underlying measurement can be refined to greater precision.
In our coffee-stall dataset, waiting time is continuous even though it is recorded to one decimal place.
The important distinction is:
Discrete data is counted. Continuous data is measured.
DISCRETE VS CONTINUOUS: QUICK COMPARISON
| Feature | Discrete | Continuous |
|---|---|---|
| Meaning | Countable values | Measured values |
| Examples | Number of children | Height |
| Typical values | Separate possible values | Any value in a range |
| Decimal values | Usually not possible for ordinary counts | Possible |
| Common graphs | Dot plot, bar chart | Histogram, box plot |
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 4: NOMINAL, ORDINAL, INTERVAL AND RATIO SCALES
There is another classification system used in statistics, psychology, scientific research and data analysis.
It identifies four levels of measurement.
Nominal
Ordinal
Interval
Ratio
The first two are categorical measurement levels.
The last two are quantitative measurement levels.
INTERVAL DATA
Interval data has equal distances between values but does not have a true zero representing the absence of the measured quantity.
The standard example is temperature measured in Celsius.
Consider:
10°C, 20°C and 30°C.
The difference between 10°C and 20°C is 10 degrees.
The difference between 20°C and 30°C is also 10 degrees.
Therefore, differences are meaningful.
However, 20°C is not twice as hot as 10°C.
Zero degrees Celsius does not mean the absence of thermal energy.
Other commonly discussed interval-scale examples include calendar years and certain standardised scores, depending on the measurement framework.
RATIO DATA
Ratio data has equal intervals and a meaningful zero.
Examples:
Height
Weight
Distance
Waiting time
Income
Number of products sold
Number of customers
If someone waits 10 minutes and another person waits 5 minutes, the first waiting time is twice the second.
A true zero represents the absence of the measured quantity.
INTERVAL VS RATIO: THE ZERO TEST
| Feature | Interval | Ratio |
|---|---|---|
| Equal intervals | Yes | Yes |
| True zero | No | Yes |
| Differences meaningful | Yes | Yes |
| Ratios meaningful | No | Yes |
| Example | Celsius temperature | Waiting time |
Remember that interval and ratio are measurement levels, while discrete and continuous describe the possible values of quantitative variables.
These classifications answer different questions.
For example, waiting time is both quantitative, continuous and ratio-scale data.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 5: TRICKY STATISTICS EXAMPLES THAT OFTEN CAUSE CONFUSION
Is age categorical or quantitative?
Exact age is quantitative.
For example, 18 years, 25 years and 42 years.
But age groups are ordinal categorical variables.
For example:
Under 18
18–24
25–34
35 and above
Grouping exact ages loses information.
Is a ZIP code quantitative?
No.
A ZIP code is a nominal identification label, even though it contains digits.
The same applies to postcodes and telephone numbers.
Is a phone number a quantitative variable?
No.
A telephone number identifies a connection or subscriber. Adding two telephone numbers has no meaningful statistical interpretation.
Is a 1–10 rating quantitative?
A single rating scale is generally ordinal.
Some researchers treat rating scores as approximately quantitative, but this requires assumptions about the spacing between responses.
Is a year quantitative?
Calendar years are usually treated as interval-scale values when analysing differences between dates.
The difference between 2000 and 2020 is 20 years.
However, a graduation class such as Class of 2024 can also function as a category label in a particular dataset.
Is shoe size quantitative or categorical?
Shoe sizes are ordered numerical measurements with conventional increments.
They are not nominal labels like telephone numbers.
Depending on the statistical framework, they may be treated as discrete numerical measurements or ordinal values.
For introductory classification questions, follow the measurement convention used by your course.
Is income categorical or quantitative?
Exact income is quantitative.
For example, $45,000 per year.
Income brackets are ordinal categorical data.
For example:
Below $25,000
$25,000–$49,999
$50,000–$74,999
$75,000 and above
Is a yes/no variable categorical?
Yes.
It is nominal and binary.
If software records Yes as 1 and No as 0, the variable remains categorical.
However, the mean of a correctly coded 0/1 variable equals the proportion of Yes responses.
For example:
Yes = 1, 1, 1, 0, 0
Mean = 3 ÷ 5 = 0.6
Therefore, 60% answered Yes.
This is a useful connection between categorical data and numerical summaries.
Is a percentage quantitative?
A percentage representing a measured score or proportion is quantitative.
For example, an examination mark of 85%.
But the categories Pass and Fail are categorical.
The central lesson: classify the actual values recorded in the dataset, not simply the real-world subject being discussed.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 6: WHICH STATISTICAL SUMMARY AND GRAPH SHOULD YOU USE?
Choosing the correct statistical summary depends on the variable type.
| Variable type | Useful centre or summary | Common graphs |
|---|---|---|
| Nominal | Mode, frequencies, percentages | Bar chart, pie chart |
| Ordinal | Median, mode, cumulative percentages | Ordered bar chart |
| Discrete quantitative | Mean, median, range | Dot plot, bar chart |
| Continuous quantitative | Mean, median, standard deviation, quartiles | Histogram, box plot |
These are useful starting points, not absolute restrictions. The choice also depends on the question, distribution and number of observations.
BAR CHART VS HISTOGRAM
This distinction is especially important in examinations.
A bar chart represents separate categories or discrete values.
There are gaps between the bars.
A histogram represents a numerical distribution grouped into intervals.
Its bars touch because the intervals form a continuous numerical scale.
For example:
A bar chart can display how many customers ordered latte, tea or hot chocolate.
A histogram can display how long customers waited.
WHY THE WRONG GRAPH COSTS MARKS
Suppose you want to display customer satisfaction categories.
A bar chart is appropriate because the responses are ordered categories.
Now suppose you want to display the distribution of waiting times.
A histogram is appropriate because waiting time is continuous numerical data.
A graph should match the structure of the variable, not simply the appearance of the numbers.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 7: FREQUENCY TABLES AND FREQUENCY DISTRIBUTIONS
A frequency table shows how many times each category or value occurs.
Frequency is simply the number of observations belonging to a particular category or value.
A frequency distribution makes a large collection of raw data easier to understand.
HOW TO CONSTRUCT A FREQUENCY TABLE
Follow these four steps:
Step 1: List the categories or values.
Step 2: Go through the raw data and record a tally for each observation.
Step 3: Count the tallies to obtain the frequencies.
Step 4: Add the frequencies and check that their total equals the sample size.
WORKED EXAMPLE: FREQUENCY TABLE FOR CATEGORICAL DATA
Using the coffee-stall dataset:
| Drink | Tally | Frequency | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Latte | 7 | ||||||||
| Tea | 6 | ||||||||
| Flat white | 4 | ||||||||
| Hot chocolate | 3 | ||||||||
| Total | 20 |
The most popular drink is latte.
It has a frequency of 7.
WHAT IS RELATIVE FREQUENCY?
Frequency tells us how many observations belong to a category.
Relative frequency tells us what proportion of the entire dataset belongs to that category.
The formula is:
Relative frequency = Frequency ÷ Total number of observations
For example:
Latte frequency = 7
Total customers = 20
Relative frequency = 7 ÷ 20 = 0.35
Percentage = 0.35 × 100 = 35%
RELATIVE FREQUENCY TABLE EXAMPLE
| Drink | Frequency | Relative frequency | Percentage |
|---|---|---|---|
| Latte | 7 | 0.35 | 35% |
| Tea | 6 | 0.30 | 30% |
| Flat white | 4 | 0.20 | 20% |
| Hot chocolate | 3 | 0.15 | 15% |
| Total | 20 | 1.00 | 100% |
Two rules are important:
Relative frequencies must be between 0 and 1.
All relative frequencies must add to 1, or 100%.
Small differences caused by rounding are normal.
WHY RELATIVE FREQUENCY IS BETTER FOR COMPARING DIFFERENT SAMPLE SIZES
Imagine two coffee stalls.
Stall A sells 7 lattes out of 20 drinks.
Stall B sells 70 lattes out of 300 drinks.
Looking only at the counts, Stall B appears more popular for lattes.
But the percentages tell a different story.
Stall A:
7 ÷ 20 × 100 = 35%
Stall B:
70 ÷ 300 × 100 = 23.33%
Stall A has the larger proportion of latte sales.
Relative frequency is particularly useful when comparing survey results, school performance, customer preferences and business statistics across groups of different sizes.
CUMULATIVE FREQUENCY: THE RUNNING TOTAL
Cumulative frequency is the running total of frequencies.
It tells you how many observations fall at or below a particular value or category in an ordered distribution.
Consider drink sizes:
| Size | Frequency | Relative frequency | Cumulative frequency | Cumulative relative frequency |
|---|---|---|---|---|
| Small | 5 | 0.25 | 5 | 0.25 |
| Medium | 9 | 0.45 | 14 | 0.70 |
| Large | 6 | 0.30 | 20 | 1.00 |
| Total | 20 | 1.00 |
Interpretation:
14 customers bought small or medium drinks.
That represents 70% of all customers.
Cumulative frequency requires an ordered variable.
It works for ordinal categories and quantitative values.
It does not have a meaningful interpretation for unordered nominal categories.
CUMULATIVE FREQUENCY FOR SATISFACTION SCORES
| Score | Frequency | Relative frequency | Cumulative frequency | Cumulative relative frequency |
|---|---|---|---|---|
| 1 | 1 | 0.05 | 1 | 0.05 |
| 2 | 2 | 0.10 | 3 | 0.15 |
| 3 | 5 | 0.25 | 8 | 0.40 |
| 4 | 8 | 0.40 | 16 | 0.80 |
| 5 | 4 | 0.20 | 20 | 1.00 |
The cumulative relative frequency reaches 0.50 at score 4.
Therefore, the median satisfaction score is 4.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 8: FREQUENCY TABLE FOR DISCRETE QUANTITATIVE DATA
Now consider the number of pastries purchased by each customer.
The values are:
0, 1, 2 or 3.
These are discrete quantitative values.
| Pastries purchased | Frequency | Relative frequency | Frequency × value |
|---|---|---|---|
| 0 | 6 | 0.30 | 0 |
| 1 | 8 | 0.40 | 8 |
| 2 | 4 | 0.20 | 8 |
| 3 | 2 | 0.10 | 6 |
| Total | 20 | 1.00 | 22 |
The final column helps calculate the mean.
Total pastries purchased = 22
Total customers = 20
Mean = 22 ÷ 20 = 1.1 pastries per customer.
THE FREQUENCY-WEIGHTED MEAN FORMULA
When data is presented in a frequency table:
Mean = Σ(f × x) ÷ Σf
Where:
f = Frequency
x = Data value
Σ = Sum of all values
This formula is useful in GCSE statistics, A-level Mathematics, AP Statistics and introductory college statistics.
Remember that frequency-weighted means are appropriate for quantitative values. A nominal category cannot be given an ordinary numerical mean merely because it has been assigned a code.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 9: GROUPED FREQUENCY TABLES FOR CONTINUOUS DATA
Continuous data often contains many different measurements.
For example, waiting times might be:
0.8, 1.2, 1.5, 1.7, 1.9, 2.1 and so on.
Instead of listing every observation separately, we can group the measurements into class intervals.
Our coffee-stall waiting times can be organised as follows:
| Waiting time (minutes) | Frequency | Relative frequency | Cumulative frequency |
|---|---|---|---|
| 0 ≤ t < 2 | 5 | 0.25 | 5 |
| 2 ≤ t < 4 | 8 | 0.40 | 13 |
| 4 ≤ t < 6 | 5 | 0.25 | 18 |
| 6 ≤ t < 8 | 2 | 0.10 | 20 |
| Total | 20 | 1.00 |
The notation 2 ≤ t < 4 means that 2 is included but 4 is excluded.
This prevents overlapping intervals.
HOW TO INTERPRET THE GROUPED FREQUENCY TABLE
The first interval contains 5 customers.
The second interval contains 8 customers.
Therefore:
13 customers waited less than 4 minutes.
Percentage = 13 ÷ 20 × 100 = 65%.
Only 2 customers waited at least 6 minutes.
Percentage = 2 ÷ 20 × 100 = 10%.
The grouped frequency table makes the overall distribution easier to understand.
HOW TO ESTIMATE THE MEAN FROM GROUPED DATA
When exact observations are unavailable, use the midpoint of each class interval.
The midpoint is:
Midpoint = (Lower boundary + Upper boundary) ÷ 2
For our table:
| Class interval | Midpoint | Frequency | Midpoint × frequency |
|---|---|---|---|
| 0 to under 2 | 1 | 5 | 5 |
| 2 to under 4 | 3 | 8 | 24 |
| 4 to under 6 | 5 | 5 | 25 |
| 6 to under 8 | 7 | 2 | 14 |
| Total | 20 | 68 |
Estimated mean:
68 ÷ 20 = 3.4 minutes.
Notice that this is an estimate.
The exact mean from the original observations is:
67.8 ÷ 20 = 3.39 minutes.
The difference occurs because grouping replaces the original measurements with class midpoints.
HOW MANY CLASS INTERVALS SHOULD A FREQUENCY TABLE HAVE?
For many ordinary classroom datasets, approximately 5–10 intervals provide a useful starting point.
However, the appropriate number depends on:
Sample size.
Range of the data.
Shape of the distribution.
Width of the intervals.
Purpose of the analysis.
Intervals should not overlap.
They should cover the full data range.
Equal-width intervals are often convenient, although unequal-width intervals may sometimes be appropriate.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 10: FREQUENCY TABLES IN EXCEL AND GOOGLE SHEETS
Frequency distributions are not limited to handwritten calculations.
Spreadsheet software can generate frequency tables automatically.
COUNTIF FUNCTION
To count the number of latte orders in cells B2:B21:
=COUNTIF(B2,"Latte")
This counts observations matching the specified category.
RELATIVE FREQUENCY IN EXCEL
If the frequency is in cell C2 and the total is in C6:
=C2/$C$6
Format the result as a percentage.
PIVOT TABLES
For larger datasets, a Pivot Table can quickly generate a frequency distribution.
Basic procedure:
Select the dataset.
Insert a Pivot Table.
Place the categorical variable in Rows.
Place the same variable in Values.
Change the calculation to Count if necessary.
Excel and Google Sheets can also generate charts from the resulting frequency tables.
PYTHON AND PANDAS
For people working with data analysis:
df["Drink"].value_counts()
This calculates category frequencies.
To calculate relative frequencies:
df["Drink"].value_counts(normalize=True)
This is useful for introductory data science, statistics and exploratory data analysis.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 11: TWO-WAY TABLES AND CONTINGENCY TABLES
A frequency table describes one variable.
A two-way table describes two categorical variables simultaneously.
It is also called:
Two-way frequency table.
Contingency table.
Cross-tabulation.
Crosstab.
Two-way tables help us investigate relationships between categorical variables.
For example:
Does the type of drink a customer orders have any association with whether they eat in or take away?
We can investigate this using our coffee-stall dataset.
HOW TO CONSTRUCT A TWO-WAY FREQUENCY TABLE
Choose two categorical variables:
Variable 1: Drink.
Variable 2: Service type.
Place one variable in the rows and the other in the columns.
Count the observations belonging to each combination.
The resulting table is:
| Drink | Eat in | Take away | Row total |
|---|---|---|---|
| Latte | 3 | 4 | 7 |
| Tea | 5 | 1 | 6 |
| Flat white | 1 | 3 | 4 |
| Hot chocolate | 2 | 1 | 3 |
| Column total | 11 | 9 | 20 |
The bottom-right value is the grand total.
It represents all 20 customers.
UNDERSTANDING THE VOCABULARY OF TWO-WAY TABLES
Joint frequency
The number inside an individual cell.
For example, 5 customers ordered tea and ate in.
Marginal frequency
A row or column total.
For example:
6 customers ordered tea.
11 customers ate in.
Grand total
The total number of observations.
In our example, it is 20.
Joint relative frequency
A cell frequency divided by the grand total.
Marginal relative frequency
A row or column total divided by the grand total.
Conditional relative frequency
A cell frequency divided by the relevant row or column total.
The most important skill is knowing which denominator to use.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 12: JOINT, MARGINAL AND CONDITIONAL RELATIVE FREQUENCY
This is one of the most important sections of introductory statistics.
Many students understand the arithmetic but select the wrong denominator.
Here is a simple method.
Always ask: OUT OF WHOM?
Consider the cell containing 5 customers who ordered tea and ate in.
There are three different questions we can ask.
QUESTION 1: WHAT PERCENTAGE OF ALL CUSTOMERS ORDERED TEA AND ATE IN?
The total number of customers is 20.
Calculation:
5 ÷ 20 × 100 = 25%.
This is the joint relative frequency.
QUESTION 2: WHAT PERCENTAGE OF TEA DRINKERS ATE IN?
There are 6 tea drinkers.
Calculation:
5 ÷ 6 × 100 = 83.33%.
This is a conditional percentage using the tea row total.
QUESTION 3: WHAT PERCENTAGE OF EAT-IN CUSTOMERS ORDERED TEA?
There are 11 eat-in customers.
Calculation:
5 ÷ 11 × 100 = 45.45%.
This is a conditional percentage using the eat-in column total.
The same cell produces three different percentages.
The only thing that changes is the denominator.
JOINT RELATIVE FREQUENCY TABLE
Every cell is divided by 20.
| Drink | Eat in | Take away | Row total |
|---|---|---|---|
| Latte | 0.15 | 0.20 | 0.35 |
| Tea | 0.25 | 0.05 | 0.30 |
| Flat white | 0.05 | 0.15 | 0.20 |
| Hot chocolate | 0.10 | 0.05 | 0.15 |
| Column total | 0.55 | 0.45 | 1.00 |
Notice that the margins reproduce the relative frequency distribution of each individual variable.
ROW PERCENTAGES
For row percentages, divide each cell by its row total.
Every row should add to 100%.
| Drink | Eat in | Take away | Total |
|---|---|---|---|
| Latte | 42.9% | 57.1% | 100% |
| Tea | 83.3% | 16.7% | 100% |
| Flat white | 25.0% | 75.0% | 100% |
| Hot chocolate | 66.7% | 33.3% | 100% |
Interpretation:
83.3% of tea drinkers ate in.
Only 25% of flat white drinkers ate in.
COLUMN PERCENTAGES
For column percentages, divide each cell by its column total.
Every column should add to 100%.
| Drink | Eat in | Take away |
|---|---|---|
| Latte | 27.3% | 44.4% |
| Tea | 45.5% | 11.1% |
| Flat white | 9.1% | 33.3% |
| Hot chocolate | 18.2% | 11.1% |
| Total | 100% | 100% |
Interpretation:
Among all customers who ate in, 45.5% ordered tea.
Among customers who took their drinks away, 44.4% ordered latte.
Small differences in totals can occur when percentages are rounded.
THE DENOMINATOR MEMORY TRICK
| Question wording | Divide by |
|---|---|
| Out of everyone | Grand total |
| Out of a particular row | Row total |
| Out of a particular column | Column total |
This single rule solves a large proportion of conditional relative frequency questions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 13: HOW TO IDENTIFY ASSOCIATION BETWEEN TWO CATEGORICAL VARIABLES
A two-way table does more than count observations.
It can help us investigate whether two categorical variables are associated.
Two variables are associated when knowing the value of one provides information about the likely value of the other.
In our example:
Overall, 55% of customers ate in.
But:
83.3% of tea drinkers ate in.
Only 25% of flat white drinkers ate in.
These differences suggest an association between drink choice and service type in our sample.
THE GAP CHECK METHOD
Compare the conditional percentages with the overall percentage.
Overall eat-in percentage = 55%.
Tea drinkers = 83.3%.
Difference = 28.3 percentage points.
Flat white drinkers = 25%.
Difference = 30 percentage points below the overall figure.
These differences suggest that the service preferences vary across drink categories.
ASSOCIATION DOES NOT MEAN CAUSATION
This distinction is essential.
The data does not prove that ordering tea causes customers to stay.
There may be other explanations.
For example:
Tea drinkers may have more free time.
Flat white customers may be commuting.
Different customers may visit at different times.
The sample may be too small to represent the wider population.
A statistical association identifies a relationship in the observed data.
It does not automatically establish a cause-and-effect relationship.
For formal analysis, a chi-square test of independence can be used to investigate whether the observed association is stronger than would reasonably be expected from random variation, subject to the test's assumptions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 14: SIMPSON'S PARADOX: WHEN COMBINING DATA REVERSES THE RESULT
Sometimes an overall percentage tells a different story from the percentages within individual groups.
This phenomenon is called Simpson's paradox.
Consider two fictional market stalls.
Both serve 100 customers.
Customers are asked whether they are happy with the service.
WEEKDAY RESULTS
Stall A:
81 happy customers out of 90.
81 ÷ 90 = 90%.
Stall B:
19 happy customers out of 20.
19 ÷ 20 = 95%.
Stall B performs better.
WEEKEND RESULTS
Stall A:
5 happy customers out of 10.
5 ÷ 10 = 50%.
Stall B:
48 happy customers out of 80.
48 ÷ 80 = 60%.
Again, Stall B performs better.
NOW COMBINE BOTH GROUPS
Stall A:
81 + 5 = 86 happy customers.
86 ÷ 100 = 86%.
Stall B:
19 + 48 = 67 happy customers.
67 ÷ 100 = 67%.
The overall result now appears to favour Stall A.
Yet Stall B had the higher satisfaction percentage on both weekdays and weekends.
Why?
Because Stall B served many more customers during weekends, when satisfaction was lower.
The distribution of customers across the two groups changed the overall result.
This is why statistical comparisons must consider group sizes and potentially important third variables.
A two-way table is useful, but a more complicated dataset may require stratification or additional statistical analysis.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 15: COMMON EXAMINATION MISTAKES IN STATISTICS
Here are ten mistakes worth avoiding.
1. Assuming every number is quantitative.
A postcode or telephone number is a label.
2. Confusing nominal and ordinal data.
Nominal categories have no natural order. Ordinal categories do.
3. Confusing discrete and continuous variables.
Counting and measuring are different processes.
4. Treating every rating scale as a perfect numerical ruler.
A single satisfaction rating is normally ordinal.
5. Drawing a histogram for nominal categories.
Categorical data is usually represented by a bar chart.
6. Forgetting the sample size when calculating relative frequency.
Always divide by the correct total.
7. Adding cumulative frequencies to unordered nominal data.
Cumulative frequency requires an order.
8. Using overlapping class intervals.
A value must belong to exactly one interval.
9. Using the grand total for every conditional percentage.
The denominator depends on the wording of the question.
10. Claiming that association proves causation.
A relationship in a dataset does not automatically establish cause and effect.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 16: PRACTICE QUESTIONS WITH ANSWERS
Test whether you can identify statistical variables and calculate frequency and conditional percentages.
SECTION A: CLASSIFY THE VARIABLE
Classify each variable as nominal, ordinal, discrete quantitative or continuous quantitative.
Blood group.
Finishing position in a school race.
Number of siblings.
Height of a student.
Football shirt number.
Customer rating from 1 to 5.
Temperature in Celsius.
ZIP code.
Age group: under 18, 18–34, 35 and above.
Time taken to complete a puzzle.
ANSWERS: SECTION A
Nominal.
Ordinal.
Discrete quantitative.
Continuous quantitative.
Nominal.
Ordinal, when treated as a single rating item.
Continuous quantitative, interval scale.
Nominal.
Ordinal.
Continuous quantitative.
SECTION B: FREQUENCY AND RELATIVE FREQUENCY
A teacher asks 12 students how they travel to school.
The answers are:
Bus, Walk, Bus, Car, Walk, Bus, Bike, Walk, Bus, Car, Bus, Walk.
Construct a frequency table.
Calculate the relative frequency of each travel method.
What percentage of students travel by bus?
ANSWERS: SECTION B
| Travel method | Frequency | Relative frequency | Percentage |
|---|---|---|---|
| Bus | 5 | 0.417 | 41.7% |
| Walk | 4 | 0.333 | 33.3% |
| Car | 2 | 0.167 | 16.7% |
| Bike | 1 | 0.083 | 8.3% |
| Total | 12 | 1.000 | 100% |
Bus percentage:
5 ÷ 12 × 100 = 41.67%.
Approximately 41.7% of students travel by bus.
SECTION C: TWO-WAY FREQUENCY TABLE
A class of 60 students is asked whether they walk or take the bus to school.
| Walk | Bus | Total | |
|---|---|---|---|
| Boys | 12 | 18 | 30 |
| Girls | 21 | 9 | 30 |
| Total | 33 | 27 | 60 |
What percentage of girls walk?
What percentage of walkers are boys?
What percentage of all students are boys who take the bus?
Does the sample suggest an association between gender and travel method?
ANSWERS: SECTION C
14. Percentage of girls who walk
21 ÷ 30 × 100 = 70%.
15. Percentage of walkers who are boys
12 ÷ 33 × 100 = 36.36%.
16. Percentage of all students who are boys taking the bus
18 ÷ 60 × 100 = 30%.
17. Is there an association?
Yes, the sample suggests an association.
Percentage of boys who walk:
12 ÷ 30 × 100 = 40%.
Percentage of girls who walk:
21 ÷ 30 × 100 = 70%.
The overall percentage of walkers is:
33 ÷ 60 × 100 = 55%.
The conditional percentages differ from the overall percentage, suggesting an association in this sample.
This does not establish causation or prove that the same pattern exists in a larger population.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 17: QUICK REVISION SHEET FOR STATISTICS EXAMS
TYPES OF VARIABLES
STICKER = NOMINAL
Names and categories without order.
Examples: blood group, eye colour, favourite food.
LADDER = ORDINAL
Categories with a meaningful order.
Examples: satisfaction ratings, rankings, small/medium/large.
RULER = QUANTITATIVE
Genuine numerical quantities.
DISCRETE = COUNTED
Examples: children, books, goals.
CONTINUOUS = MEASURED
Examples: height, weight, time.
FOUR LEVELS OF MEASUREMENT
Nominal = Identity.
Ordinal = Identity + Order.
Interval = Identity + Order + Equal intervals.
Ratio = Identity + Order + Equal intervals + True zero.
FREQUENCY FORMULAS
Frequency = Number of observations.
Relative frequency = Frequency ÷ Total frequency.
Percentage frequency = Relative frequency × 100.
Cumulative frequency = Running total of frequencies.
Mean from a frequency table = Σ(f × x) ÷ Σf.
Estimated mean from grouped data = Σ(f × midpoint) ÷ Σf.
TWO-WAY TABLE FORMULAS
Joint relative frequency = Cell frequency ÷ Grand total.
Marginal relative frequency = Row or column total ÷ Grand total.
Conditional relative frequency = Cell frequency ÷ Relevant row or column total.
GRAPH SELECTION
Categorical data = Bar chart.
Ordered categorical data = Ordered bar chart.
Quantitative discrete data = Dot plot or bar chart.
Continuous data = Histogram or box plot.
THE MOST IMPORTANT QUESTION
Before calculating a percentage in a two-way table, ask:
OUT OF WHOM?
That tells you which denominator to use.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
FINAL THOUGHT: UNDERSTAND THE VARIABLE BEFORE CALCULATING
A spreadsheet can contain thousands of numbers and still contain very little quantitative information.
Some numbers measure real quantities.
Others simply identify people, products, locations or categories.
The difference determines which statistical calculations are meaningful.
Remember the Sticker, Ladder and Ruler method:
A sticker identifies.
A ladder ranks.
A ruler measures.
Once you understand that distinction, identifying nominal, ordinal, discrete and continuous variables becomes much easier.
From there, frequency distributions, relative frequency tables, cumulative frequency, histograms and two-way tables become parts of one connected system rather than a collection of unrelated formulas.
That is the real purpose of learning statistical data classification: choosing the correct way to describe, summarise and interpret the information in front of you.
No comments:
Post a Comment
please leave your comments