The Language of Variation: Variables
Introduced
9:03
Exploring One-Variable Data
Measure the same thing twenty times and you will not get the same answer twenty times. Twenty students measure the same table. The values vary. That is not a…
English narration · English and 中文 subtitles you can switch
In this lesson
| English | Meaning |
|---|---|
| categorical/ˌkætɪˈɡɒrɪkl/ | Describing data whose values identify groups or labels rather than numerical amounts. |
| quantitative/ˈkwɒntɪteɪtɪv/ | Based on numerical values, measurements or counts. |
| Discrete/dɪˈskriːt/ | Consisting of separate, distinct values rather than a continuous range. |
| Continuous/kənˈtɪnjuːəs/ | Changing without a break or jump, or taking every value within an interval. |
Not all variables are the same
- Before you graph or summarize data, you must know what kind of variable you have.
- The big split: categorical 分类 (labels/groups) vs. quantitative 定量 (numbers you can do arithmetic on).
- The type decides which graphs and which summaries make sense.
- Choosing the wrong tool for the type is a classic mistake — so classify first.
Categorical vs. quantitative
- A categorical variable records a group or label: eye color, favorite sport, yes/no.
- A quantitative variable is a measured number you can average: height, age, test score.
- Quick test: does averaging the values make sense? If yes → quantitative; if no → categorical.
- (Zip codes look numeric but are categorical — you'd never average them.)

Categorical variables sort cases into groups; quantitative variables are numbers you can average
Categorical or quantitative?
Decide whether each variable is a label (categorical) or a number you can average (quantitative).
Eye color is a ____ variable.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
It records a label/group → categorical.
A quick test: a variable is quantitative if taking its ____ makes sense.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Averaging works for numbers, not labels.
Discrete vs. continuous
- Quantitative variables come in two flavors.
- Discrete 离散 variables take countable, separate values (number of siblings: $0,1,2,\dots$).
- Continuous 连续 variables can take any value in a range (height: $170.3$ cm, $170.34$ cm, …).
- Counting → discrete; measuring → usually continuous.
Number of pets is a quantitative variable that is...
Difficulty 1/5 · 100 coins + a small bonus on first completion today
A count takes separate whole values → discrete.
Height measured in cm is quantitative and...
Difficulty 1/5 · 100 coins + a small bonus on first completion today
It can take any value in a range → continuous.
Type dictates the tools
- Categorical → bar charts, pie charts, frequency tables, proportions.
- Quantitative → histograms, dotplots, boxplots, mean, standard deviation.
- Using a quantitative tool (like a mean) on a categorical variable is meaningless.
- So always classify the variable before picking a graph or summary.
A zip code, though written with digits, is a categorical variable.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Averaging zip codes is meaningless → categorical.
Which graphs suit a categorical variable?
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Bar/pie for categorical; histogram/boxplot for quantitative.
Numbers aren't always quantitative. A variable coded with numbers (zip code, jersey number, a $1$–$5$ "strongly agree" scale used as labels) can still be categorical if averaging it is meaningless. Ask: "Does arithmetic make sense here?" That, not the appearance, decides the type.
Classify each variable for a group of students.
- Favorite subject: labels → categorical.
- Number of siblings: a count → quantitative, discrete.
- Height (cm): a measurement → quantitative, continuous.
Classify a variable as categorical (labels/groups) or quantitative (numbers you can average). Quantitative splits into discrete (countable) and continuous (any value in a range). The type decides which graphs and summaries are valid — and numbers used as labels are still categorical.
Write from this case
- A survey records eye colour and the number of pets.
- Eye colour is a label. The pet count is a number.
A survey records eye colour and number of pets. Classify both variables and explain whether the pet count is discrete or continuous.
A count is a number. A colour is a category.
What kind of variable is the number of pets?
Difficulty 1/5 · 100 coins + a small bonus on first completion today
A pet count is quantitative because arithmetic on counts is meaningful, and discrete because it takes whole-number values.
What went wrong? Only the site team sees this.