# Data types and sampling

> IB Mathematics AA Higher Level · IB AA HL
> Source: https://www.owlsprep.com/study/ib-math-aa-hl-u4-data-types-and-sampling/

This module covers core classification of statistical data and key sampling methods, teaching you to identify bias and select valid approaches for data collection, a foundational skill for all statistics topics in IB AA HL.

**Prerequisites:** Basic familiarity with general statistical study design

## Learning objectives

- Distinguish between qualitative, discrete quantitative and continuous quantitative data types
- Describe and compare common sampling methods
- Identify sources of sampling bias and distinguish between bias and sampling error
- Select appropriate sampling for a given research context

## Classifying Data Types

**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.

**Worked example:** 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 command terms**

- **Classify** — State the correct category of the variable or sampling method, with a brief justification if required *(Always explain why you selected a particular classification)*

> **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).

## Common Sampling Methods

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 $k$-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.

**Worked example:** 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. $$\text{Proportion} = \frac{1500}{12000} = 0.125$$
3. Multiply the proportion by the total sample size to get the number of fourth year students to sample:
4. $$0.125 \times 240 = 30$$
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.

## Sampling Bias and Error

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.

> **warning**
>
> Convenience sampling almost always contains significant bias, so it can never be used to draw general conclusions about a population.

**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.

**Worked example:** 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.

## Common pitfalls

- **Wrong:** Classifying age as discrete because it is usually reported as whole years.
  - Why it fails: Age is a continuous measurement that can take any value, e.g. 17.5 years.
  - Correct: Classify age as continuous, unless it is explicitly counted as a whole number of years for a specific study.
- **Wrong:** Confusing random sampling error with sampling bias.
  - Why it fails: 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: Only systematic over/under-representation of groups is bias, random variation is not bias.
- **Wrong:** Taking equal sized samples from each stratum in stratified sampling, regardless of stratum size.
  - Why it fails: This leads to over-representation of small strata and under-representation of large strata, introducing unnecessary bias.
  - Correct: Always sample proportionally to the size of each stratum in the total population.
- **Wrong:** Assuming a census has no error of any kind.
  - Why it fails: A census can still have non-sampling error from non-response, incorrect measurement, or missing data.
  - Correct: Recognize that error can exist even when the entire population is measured.
- **Wrong:** Confusing stratified sampling with simple random sampling.
  - Why it fails: Stratified sampling splits the population into groups first before sampling, while simple random samples directly from the whole population.
  - Correct: Remember: stratified = split into strata first, then sample from each group.

## 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 $k$-th member selected, low bias risk |
| Sampling | Stratified | Proportional sample from strata, lowest bias risk |
| Sampling | Convenience | Easily accessible members, very high bias risk |

## 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.

- [Data presentation and summary statistics](https://www.owlsprep.com/study/ib-math-aa-hl-u4-data-presentation-and-summary-statistics/)
- [Basic probability concepts and rules](https://www.owlsprep.com/study/ib-math-aa-hl-u4-basic-probability-concepts-and-rules/)
- [Conditional probability and Bayes' theorem](https://www.owlsprep.com/study/ib-math-aa-hl-u4-conditional-probability-and-bayes-theorem/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/ib-math-aa-hl-u4-data-types-and-sampling/
