The Language of Variation: Variables · 变异的语言:变量
| English | 中文 | Pinyin · 拼音 |
|---|---|---|
| categorical/ˌkætɪˈɡɒrɪkl/ | 分类 | fēn lèi |
| quantitative/ˈkwɒntɪteɪtɪv/ | 定量 | dìng liàng |
| Discrete/dɪˈskriːt/ | 离散 | lí sàn |
| Continuous/kənˈtɪnjuːəs/ | 连续 | lián xù |
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.
并非所有变量都相同
- 在你作图或汇总数据之前,必须知道你手上是哪种变量。
- 大的划分:分类变量(标签/组)vs 数量变量(能做算术的数)。
- 类型决定哪些图和哪些汇总有意义。
- 为类型选错工具是经典错误——所以先分类。
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.)
分类 vs 数量
- 分类变量记录一个组或标签:眼睛颜色、最喜欢的运动、是/否。
- 数量变量是一个能求平均的测量数:身高、年龄、考试分数。
- 快速判断:对这些值求平均有意义吗?若有 → 数量;若无 → 分类。
- (邮政编码看似数字却是分类——你绝不会给它们求平均。)
Categorical or quantitative? · 分类变量还是定量变量?
Decide whether each variable is a label (categorical) or a number you can average (quantitative). · 判断每个变量是标签(分类)还是可以取平均值的数字(定量)。
Eye color is a ____ variable. · 眼睛颜色是一个____变量。
It records a label/group → categorical. · 它记录标签/组别 → 分类变量。
A quick test: a variable is quantitative if taking its ____ makes sense. · 快速测试:如果一个变量的____有意义,则它是定量变量。
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.
离散 vs 连续
- 数量变量有两种类型。
- 离散变量取可数、分离的值(兄弟姐妹数:$0,1,2,\dots$)。
- 连续变量可取一个范围内的任意值(身高:$170.3$ cm、$170.34$ cm、……)。
- 计数 → 离散;测量 → 通常连续。
Number of pets is a quantitative variable that is... · 宠物数量是一个定量变量,它是……
A count takes separate whole values → discrete. · 计数取独立的整数值 → 离散型。
Height measured in cm is quantitative and... · 以厘米为单位的身高是定量且……
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. · 邮政编码虽然用数字书写,但属于分类变量。
Averaging zip codes is meaningless → categorical. · 对邮政编码求平均值没有意义 → 分类变量。
Which graphs suit a categorical variable? · 哪些图表适合展示分类变量?
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.
数字不总是数量的。 用数字编码的变量(邮编、球衣号、当作标签用的 $1$–$5$"非常同意"量表)若求平均无意义,仍可以是分类的。问:"这里做算术有意义吗?"是它(而非外观)决定类型。
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.
为一组学生分类各变量。
- 最喜欢的科目: 标签 → 分类。
- 兄弟姐妹数: 一个计数 → 数量,离散。
- 身高(cm): 一个测量 → 数量,连续。
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.
把变量分类为分类(标签/组)或数量(能求平均的数)。数量分为离散(可数)和连续(范围内任意值)。类型决定哪些图和汇总有效——用作标签的数字仍是分类的。