Data types and sampling
IB Mathematics AA Higher LevelΒ· Unit 4: Statistics & Probability, Topic 1: Data types and samplingΒ· 15 min read
1. Classifying Data Typesβ βββββ± 5 min
Data Classification
Data is categorized by its nature, and the category determines what types of statistical analysis can be applied to it.
Example:
You cannot calculate a mean average for categorical data like eye color.
The primary split is between qualitative (categorical) data (non-numerical attributes) and quantitative data (numerical measurements or counts). Quantitative data is further split into discrete and continuous variables.
Discrete vs Continuous Variables
Discrete variables can only take distinct, separate values (almost always counts). Continuous variables can take any value within an interval, and are the product of measurement.
Example:
Number of cars owned is discrete; the weight of a car is continuous.
Classify each variable as qualitative, discrete quantitative, or continuous quantitative: (a) The color of a student's car, (b) The distance a student commutes to school, (c) The number of cars a student owns.
- 1
For (a): Car color is a non-numerical attribute, so it is qualitative data.
- 2
For (b): Commute distance is a measurement that can take any value between two numbers, so it is continuous quantitative data.
- 3
For (c): Number of cars can only be a whole number (distinct values), so it is discrete quantitative data.
Exam tip:
Even if a variable is rounded to whole numbers, it is still continuous if it is fundamentally a measurement (e.g. age in whole years is still continuous).
2. Common Sampling Methodsβ β ββββ± 6 min
When collecting data, you can either run a census (collect data from every member of the population) or take a sample (collect data from a subset). You need to know four core sampling methods for IB AA HL:
Simple random sampling: Every sample of the same size has an equal chance of being selected, usually generated with random numbers.
Systematic sampling: Every -th member of the population is selected from an ordered list, starting from a random first position.
Stratified sampling: The population is split into relevant subgroups (strata), then random samples are taken from each stratum proportional to stratum size.
Convenience sampling: Selects individuals that are easiest to reach, with no randomization.
A university has 12000 undergraduate students: 4500 first year, 3500 second year, 2500 third year, 1500 fourth year. A researcher wants a stratified sample of 240 students by year. How many fourth year students should be sampled?
- 1
Calculate the proportion of the population that is fourth year:
- 2
- 3
Multiply the proportion by the total sample size to get the number of fourth year students to sample:
- 4
- 5
The researcher should sample 30 fourth year students.
Exam tip:
For stratified sampling, always sample proportional to stratum size, not equally, unless explicitly told otherwise.
3. Sampling Bias and Errorβ β ββββ± 4 min
A valid sample must be representative of the population of interest. Sampling bias is a systematic error where some members of the population are more or less likely to be selected than others, leading to skewed results.
Sampling Error
The natural random difference between a sample statistic and the true population parameter, caused by random variation in sample selection. Sampling error decreases as sample size increases.
Example:
A random sample of 100 students will have a smaller sampling error for average height than a random sample of 10 students.
A researcher wants to find the average amount of money IB students spend on lunch per week. They stand outside the school's expensive cafeteria and ask the first 15 students they leave. What bias is likely to occur, and how will it affect the result?
- 1
Students who eat at the expensive cafeteria are more likely to spend more money on lunch than the general student population.
- 2
This is selection bias, where the sample systematically over-represents students with higher lunch spending.
- 3
The researcher's result will overestimate the true average lunch spending for all IB students at the school.
4. Common Pitfalls
Wrong move:
Classifying age as discrete because it is usually reported as whole years.
Why:
Age is a continuous measurement that can take any value, e.g. 17.5 years.
Correct move:
Classify age as continuous, unless it is explicitly counted as a whole number of years for a specific study.
Wrong move:
Confusing random sampling error with sampling bias.
Why:
Random error is natural variation that reduces with larger sample size, while bias is a systematic error that does not disappear with larger samples.
Correct move:
Only systematic over/under-representation of groups is bias, random variation is not bias.
Wrong move:
Taking equal sized samples from each stratum in stratified sampling, regardless of stratum size.
Why:
This leads to over-representation of small strata and under-representation of large strata, introducing unnecessary bias.
Correct move:
Always sample proportionally to the size of each stratum in the total population.
Wrong move:
Assuming a census has no error of any kind.
Why:
A census can still have non-sampling error from non-response, incorrect measurement, or missing data.
Correct move:
Recognize that error can exist even when the entire population is measured.
Wrong move:
Confusing stratified sampling with simple random sampling.
Why:
Stratified sampling splits the population into groups first before sampling, while simple random samples directly from the whole population.
Correct move:
Remember: stratified = split into strata first, then sample from each group.
5. Quick Reference Cheatsheet
Category | Type | Key Feature / Bias Risk |
|---|---|---|
Data Type | Qualitative (Categorical) | Non-numerical attribute, e.g. eye color |
Data Type | Discrete Quantitative | Numerical distinct values (counts), e.g. number of students |
Data Type | Continuous Quantitative | Numerical any value in range (measurements), e.g. height |
Sampling | Simple Random | All samples equally likely, low bias risk |
Sampling | Systematic | Every -th member selected, low bias risk |
Sampling | Stratified | Proportional sample from strata, lowest bias risk |
Sampling | Convenience | Easily accessible members, very high bias risk |
6. Frequently Asked
Is a census always better than a sample?
No. A census is time-consuming, expensive, and often impossible (e.g. for destructive testing). A well-selected random sample can produce accurate results with far lower cost and effort.
Can continuous data ever be treated as discrete?
Yes, when measured to finite precision. For example, height measured to the nearest centimeter becomes discrete for analysis, but it is still fundamentally a continuous variable.
When this came up on past exams
AI-estimated based on syllabus patterns β cross-check with official past papers for accuracy. Use only as revision-focus signals.
- 2025 Β· 2
Identify type of sampling method used
- 2024 Β· 1
Classify given variables by data type
- 2023 Β· 2
Comment on sources of bias in a study
What's Next
Data types and sampling is the foundation of all statistical work in IB AA HL. Correct data classification determines what analysis you can perform, and appropriate sampling ensures your conclusions are valid and generalizable. Once you have collected and classified data, the next step is to summarize it using descriptive statistics, then visualize it to identify patterns and relationships. These foundational skills are required for all inferential statistics topics later in the course, including hypothesis testing and regression.
