The Language of Variation: Variables
Đã giới thiệu| English | Ý nghĩa |
|---|---|
| categorical/ˌkætɪˈɡɒrɪkl/ | phân loại |
| quantitative/ˈkwɒntɪteɪtɪv/ | định lượng |
| Discrete/dɪˈskriːt/ | rời rạc |
| Continuous/kənˈtɪnjuːəs/ | liên tục |
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.
Độ khó 1/5 · 100 xu + một phần thưởng nhỏ cho lần hoàn thành đầu tiên trong ngày
It records a label/group → categorical.
A quick test: a variable is quantitative if taking its ____ makes sense.
Độ khó 1/5 · 100 xu + một phần thưởng nhỏ cho lần hoàn thành đầu tiên trong ngày
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...
Độ khó 1/5 · 100 xu + một phần thưởng nhỏ cho lần hoàn thành đầu tiên trong ngày
A count takes separate whole values → discrete.
Height measured in cm is quantitative and...
Độ khó 1/5 · 100 xu + một phần thưởng nhỏ cho lần hoàn thành đầu tiên trong ngày
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.
Độ khó 1/5 · 100 xu + một phần thưởng nhỏ cho lần hoàn thành đầu tiên trong ngày
Averaging zip codes is meaningless → categorical.
Which graphs suit a categorical variable?
Độ khó 2/5 · 140 xu + một phần thưởng nhỏ cho lần hoàn thành đầu tiên trong ngày
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 a quantitative count
- A survey records eye colour and the number of pets.
- Eye colour is a label. The pet count is a number.
What kind of variable is the number of pets?
A count is a number. A colour is a category.
What kind of variable is the number of pets?
Độ khó 1/5 · 100 xu + một phần thưởng nhỏ cho lần hoàn thành đầu tiên trong ngày
Pets are counted in whole numbers.