跳到主要内容

探索双变量数据

AP 统计学 · 知识点 2

本主题的视频课程 打开视频页面
7:49

探索双变量数据

来自一所小学三十名儿童的数据。对每个孩子记录两个数值:鞋码和阅读测试成绩。每孩标出一个点。该模式难以…

英语旁白 · 英中内嵌字幕

2.1

统计学导论:变量之间有关联吗?

教学大纲

持久理解(VAR-1): 变异可能是随机的,也可能不是随机的,因此结论具有不确定性。

学习目标 VAR-1.D: 识别关于数据中潜在关系的问题。[技能 1.A]

  • VAR-1.D.1 数据中 apparent patterns and associations may be random or not.

来源:College Board AP 课程与考试说明

English

Two-variable data let us ask whether two characteristics are associated 关联 – whether knowing one tells you something about the other. An explanatory variable 解释变量 (the "input") may help predict a response variable 响应变量 (the "output"). Association is not the same as causation.

词汇 训练
English 中文 拼音
associated/əˈsəʊsɪeɪtɪd/ 关联 guān lián
explanatory variable/ekˈsplænətəri ˈveərɪəbl/ 解释变量 jiě shì biàn liàng
response variable/rɪˈspɒns ˈveərɪəbl/ 响应变量 xiǎng yìng biàn liàng
2.2

表示两个分类变量

教学大纲

持久理解 (UNC-1): 图形表示和统计方法使我们能够识别并呈现数据的关键特征。

学习目标 UNC-1.P: 比较两个分类变量的数值和图形表示方法。[技能 2.D]

  • UNC-1.P.1 并排条形图、分段条形图和镶嵌图是单分类变量条形图的示例,按另一分类变量的类别进行细分。
  • UNC-1.P.2 两个分类变量的图形表示可用于比较分布以及/或判断变量之间是否存在关联。
  • UNC-1.P.3 列联表(也称为交叉表)用于汇总两个分类变量。单元格中的条目可以是频数计数或相对频率。
  • UNC-1.P.4 联合相对频率是指某个单元格的频数除以整个表格的总数。

来源:College Board AP 课程与考试说明

English

A two-way table 双向表 (contingency table) counts individuals by two categorical variables at once. A marginal distribution 边缘分布 is a row or column total written as a fraction of the grand total (the totals themselves are just counts). Comparing the inside cells shows whether the variables are related.

探索

一个分类的构成

每一块是某一类别在整体中所占的份额。

词汇 训练
English 中文 拼音
two-way table/tuː weɪ ˈteɪbl/ 双向表 shuāng xiàng biǎo
marginal distributions/ˈmɑːdʒɪnl ˌdɪstrɪˈbjuːʃnz/ 边缘分布 biān yuán fēn bù
2.3

两个分类变量的统计量

教学大纲

持久理解 (UNC-1): 图形表示和统计量使我们能够识别并呈现数据的关键特征。

学习目标 UNC-1.Q: 计算两个分类变量的统计量。[技能 2.C]

  • UNC-1.Q.1 边缘相对频率是列联表中行合计与列合计分别除以整个表格总合计所得的值。
  • UNC-1.Q.2 条件相对频率是指针对列联表特定部分的相对频率(例如,某一行中的单元格频率除以该行的合计)。

学习目标 UNC-1.R: 比较两个分类变量的统计量。[技能 2.D]

  • UNC-1.R.1 两个分类变量的汇总统计量可用于比较分布以及/或判断变量之间是否存在关联。

来源:College Board AP 课程与考试说明

English

A conditional distribution 条件分布 is the distribution of one variable within a fixed category of the other (found by dividing each cell by its row or column total). If the conditional distributions differ across groups, the two variables are associated; if they are the same, there is no association. Segmented bar charts 分段条形图 or mosaic plots display them.

Worked example. A school records how $200$ students took a course and whether they passed.

Passed Failed Total
Online $60$ $40$ $100$
In person $75$ $25$ $100$
Total $135$ $65$ $200$
  • Marginal distribution of result: $\tfrac{135}{200}=0.675$ passed and $\tfrac{65}{200}=0.325$ failed.
  • Conditional distributions: online students passed at $\tfrac{60}{100}=0.60$; in-person students at $\tfrac{75}{100}=0.75$.

The conditional pass rates differ ($0.60$ vs $0.75$), so the format and the result are associated in these data. This alone does not show that the format causes the difference: students chose their format.

Divide by the correct total: “the proportion of online students who passed” uses the online total ($100$), while “the proportion of passes that were online” uses the pass total: $\tfrac{60}{135}\approx 0.44$.

A segmented bar chart compares the conditional distribution in each group
A segmented bar chart compares the conditional distribution in each group
词汇 训练
English 中文 拼音
conditional distribution/kənˈdɪʃənl ˌdɪstrɪˈbjuːʃn/ 条件分布 tiáo jiàn fēn bù
Segmented bar charts/seɡˈmentɪd bɑː tʃɑːts/ 分段条形图 fēn duàn tiáo xíng tú
2.4

表示两个定量变量之间的关系

教学大纲

持久理解 (UNC-1): 图形表示和统计量使我们能够识别并呈现数据的关键特征。

学习目标 UNC-1.S: 使用散点图表示双变量定量数据。[技能 2.B]

  • UNC-1.S.1 一个双变量定量数据集包含对样本或总体中个体的两个不同定量变量的观测值。
  • UNC-1.S.2 散点图显示每个观测值的两个数值,其中一个对应 $x$ 轴上的值,另一个对应 $y$ 轴上的值。
  • UNC-1.S.3 解释变量(explanatory variable)是指其值用于解释或预测响应变量(response variable)相应值的变量。

持久理解 (DAT-1): 回归模型可能使我们能够预测随着解释变量变化而产生的响应变化。

学习目标 DAT-1.A: 描述散点图的特征。[技能 2.A]

  • DAT-1.A.1 对散点图的描述包括形态、方向、强度和不寻常特征。
  • DAT-1.A.2 散点图中显示的关联的方向(如果存在)可以描述为正相关或负相关。
  • DAT-1.A.3 正相关意味着当一个变量的值增加时,另一个变量的值倾向于增加;负相关意味着当一个变量的值增加时,另一个变量的值倾向于减少。
  • DAT-1.A.4 散点图中显示的关联的形态(如果存在)可以在不同程度上描述为线性或非线性。
  • DAT-1.A.5 关联的强度是指单个数据点紧密遵循特定模式(例如线性)的程度,这种模式可以在散点图中显示出来。强度可以描述为强、中等或弱。
  • DAT-1.A.6 散点图的不寻常特征包括点的聚类,或者响应变量的值与其预测值之间存在较大差异的点。

来源:College Board AP 课程与考试说明

English

A scatterplot 散点图 plots each individual as a point, explanatory variable on the $x$-axis and response on the $y$-axis. Describe it with DUFS: Direction (positive/negative), Unusual features (outliers, clusters), Form (linear or curved), and Strength (how tightly the points follow the pattern) – always in context.

A line of best fit runs through the middle of the scattered points
A line of best fit runs through the middle of the scattered points
探索

带线性趋势的散点图

拖动以观察方向和强度如何改变这团点。

词汇 训练
English 中文 拼音
scatterplot/ˈskætəplɒt/ 散点图 sàn diǎn tú
2.5

相关性

教学大纲

持久理解 (DAT-1): 回归模型可能使我们能够预测解释变量变化时的响应值。

学习目标 DAT-1.B: 确定线性关系的相关性。[技能 2.C]

  • DAT-1.B.1 相关系数 $r$ 给出了方向并量化了两个定量变量之间线性关联的强度。
  • DAT-1.B.2 相关系数可以通过以下公式计算:$r = \dfrac{1}{n-1} \sum \left( \dfrac{x_i - \bar{x}}{s_x} \right) \left( \dfrac{y_i - \bar{y}}{s_y} \right)$。然而,确定 $r$ 最常用的方法是使用技术工具(统计软件或计算器)。
  • DAT-1.B.3 相关系数接近 1 或 $-1$ 并不意味着线性模型一定适用。

学习目标 DAT-1.C: 解释线性关系的相关性。[技能 4.B]

  • DAT-1.C.1 相关系数 $r$ 是无量纲的,且始终介于 $-1$ 和 1 之间(含端点)。$r = 0$ 表示不存在线性关联。$r = 1$ 或 $r = -1$ 表示存在完美的线性关联。
  • DAT-1.C.2 两个变量之间存在感知上或实际上的关系,并不意味着一个变量的变化会导致另一个变量的变化。即,相关性并不必然意味着因果关系。

来源:College Board AP 课程与考试说明

English
What r actually measures

The correlation coefficient 相关系数 $r$ measures the strength and direction of a linear relationship. It runs from $-1$ to $1$: near $\pm 1$ is strong linear, near $0$ is weak linear. $r$ has no units and does not change if you swap the variables. Warnings: $r$ only measures linear strength, it is not resistant to outliers, and a strong $r$ does not prove causation.

Positive correlation rises together; negative correlation moves in opposite directions
Positive correlation rises together; negative correlation moves in opposite directions
探索

线性关系的强度

相关系数 $r$ 的范围从 $-1$ 到 $1$:接近 $\pm1$ 时点紧密贴合一条直线,接近 0 时则分散。更改它并观察云团收紧或扩散。

词汇 训练
English 中文 拼音
correlation coefficient/ˌkɒrɪˈleɪʃn ˌkəʊɪˈfɪʃənt/ 相关系数 xiāng guān xì shù
2.6

线性回归模型

教学大纲

持久理解 (DAT-1): 回归模型可能使我们能够预测解释变量变化时的响应值。

学习目标 DAT-1.D: 使用线性回归模型计算预测响应值。[技能 2.C]

  • DAT-1.D.1 简单线性回归模型是一个使用解释变量 $x$ 来预测响应变量 $y$ 的方程。
  • DAT-1.D.2 预测响应值,记为 $\hat{y}$,通过公式 $\hat{y} = a + bx$ 计算得出,其中 $a$ 是 $y$ 轴截距,$b$ 是回归线的斜率,$x$ 是解释变量的值。
  • DAT-1.D.3 外推是指使用超出用于确定回归线的 $x$ 值区间内的解释变量值来预测响应值。外推的距离越远,预测值作为估计值的可靠性就越低。

来源:College Board AP 课程与考试说明

English

The least-squares regression line 最小二乘回归线 predicts the response: $\hat{y}=a+bx$, where $\hat{y}$ is the predicted response. The slope 斜率 $b$ is the predicted change in $y$ per one-unit increase in $x$; the $y$-intercept 截距 $a$ is the predicted $y$ when $x=0$. Interpret both in context and with units – a graded skill. Avoid extrapolation 外推 (predicting far outside the data).

From summary statistics, the line comes from two formulas: the slope is $b=r\,\dfrac{s_y}{s_x}$, and the line always passes through $(\bar x,\bar y)$, so $a=\bar y-b\bar x$.

Worked example. A study of hours studied ($x$) and test score ($y$) gives $\hat{y}=20+3x$. The slope means each extra hour of study is associated with a predicted $3$-point increase. A student who studies $5$ hours is predicted to score $\hat{y}=20+3(5)=35$.

Worked example: line from summary statistics. For another class, hours studied have $\bar x=6$ and $s_x=2$; scores have $\bar y=70$ and $s_y=10$; and $r=0.8$.

$$b=r\,\frac{s_y}{s_x}=0.8\times\frac{10}{2}=4, \qquad a=\bar y-b\bar x=70-4(6)=46.$$

So $\hat y=46+4x$: each extra hour is associated with a predicted $4$-point increase. Also $r^2=0.64$: $64\%$ of the variation in scores is explained by the linear relationship with hours studied.

Reading ŷ = a + bx: the slope is the predicted change per unit of x; the intercept is the prediction at x = 0
Reading ŷ = a + bx: the slope is the predicted change per unit of x; the intercept is the prediction at x = 0
探索

拟合最小二乘法直线

回归线是最佳直线拟合,最小化平方垂直距离。其斜率预测 $y$ 随 $x$ 每单位的变化量。

词汇 训练
English 中文 拼音
least-squares regression line/liːst skweəz rɪˈɡreʃn laɪn/ 最小二乘回归线 zuì xiǎo èr chéng huí guī xiàn
slope/sləʊp/ 斜率 xié lǜ
y-intercept/waɪ ˌɪntəˈsept/ 截距 jié jù
extrapolation/ekˈstræpəleɪʃn/ 外推 wài tuī
2.7

残差

教学大纲

持久理解 (DAT-1): 回归模型可能使我们能够预测解释变量变化时的响应值。

学习目标 DAT-1.E: 使用残差图表示测量响应与预测响应之间的差异。[技能 2.B]

  • DAT-1.E.1 残差是实际值与预测值之差:$\text{residual} = y - \hat{y}$。
  • DAT-1.E.2 残差图是将残差对解释变量值或预测响应值的作图。

学习目标 DAT-1.F: 使用残差图描述双变量数据的关联形式。[技能 2.A]

  • DAT-1.F.1 线性模型的残差图中呈现明显的随机性,是变量间关联呈线性形式的证据。
  • DAT-1.F.2 残差图可用于检验所选模型的适用性。

来源:College Board AP 课程与考试说明

English
Least-squares regression

A residual 残差 is actual minus predicted, $y-\hat{y}$: how far a point sits above (+) or below (−) the line. A residual plot 残差图 graphs residuals against $x$. If it shows no pattern (random scatter), a linear model is appropriate; a curved or fanning pattern means the linear model is a poor fit.

Worked example. Continuing the study above, a student who studied $5$ hours actually scored $40$. The residual is $y-\hat{y}=40-35=+5$: the line under-predicted by $5$ points, so this point sits above the line.

Common mistakes. Computing predicted minus actual ($35-40=-5$): a residual is always actual minus predicted. Stating the slope as a certainty (“the score goes up by $3$”) instead of a predicted change, or without units and context. Interpreting the intercept when $x=0$ lies far outside the data.

Four datasets with identical r and regression line but four different shapes
A caution about $r$ and the line: all four datasets have the same $r=0.82$ and the same $\hat{y}=3.0+0.5x$, yet only the first is genuinely linear. The scatterplots barely differ — the residual plot below each is what exposes the curve, the outlier, and the high-leverage point.
探索

残差 = 到直线的竖直间隙

每个点到直线的竖直距离就是它的残差。

词汇 训练
English 中文 拼音
residual/rɪˈsɪdʒuːəl/ 残差 cán chà
residual plot/rɪˈsɪdʒuːəl plɒt/ 残差图 cán chà tú
2.8

最小二乘回归

教学大纲

持久性理解(DAT-1): 回归模型可以让我们预测对解释变量变化的响应。

学习目标 DAT-1.G: 估计最小二乘回归线模型的参数。[技能 2.C]

  • DAT-1.G.1 最小二乘回归模型通过最小化残差平方和来构建,并且包含点 $(\bar{x}, \bar{y})$。
  • DAT-1.G.2 回归线的斜率 $b$ 可以计算为 $b = r \left( \dfrac{s_y}{s_x} \right)$,其中 $r$ 是 $x$ 和 $y$ 之间的相关系数,$s_y$ 是响应变量的样本标准差 $y$,而 $s_x$ 是解释变量的样本标准差 $x$。
  • DAT-1.G.3 有时,直线的 $y$-截距在具体情境中没有合理的解释。
  • DAT-1.G.4 在简单线性回归中,$r^2$ 是相关系数 $r$ 的平方。它也被称为决定系数。$r^2$ 表示在模型中由解释变量解释的响应变量的变异比例。

学习目标 DAT-1.H: 解释最小二乘回归线模型的系数。[技能 4.B]

  • DAT-1.H.1 最小二乘回归模型的系数是估计的斜率和 $y$-截距。
  • DAT-1.H.2 斜率表示当 $x$ 每增加一个单位时,预测的 $y$-值的变化量。
  • DAT-1.H.3 $y$-截距值是当解释变量等于 $0$ 时响应变量的预测值。$y$-截距的公式 $a$ 为 $a = \bar{y} - b\bar{x}$。

来源:College Board AP 课程与考试说明

English
The least-squares line minimizes the sum of squared residuals
The least-squares line minimizes the sum of squared residuals

The line minimizes the sum of squared residuals. Its fit is measured by:

  • $s$, the standard deviation of the residuals – the typical prediction error, in the response's units.
  • $r^2$, the coefficient of determination 决定系数 – the proportion of the variation in $y$ that the linear model explains (a value between $0$ and $1$; multiply by $100$ to state it as a percent). Report it in context: “$r^2 = 0.81$ means 81% of the variation in $y$ is explained by the linear relationship with $x$.”

Common mistakes. Saying $r=0.8$ means “$80\%$ of the variation is explained”: that statement belongs to $r^2=0.64$. Calling $r\approx0$ “no relationship”: a strong curve can have $r$ near $0$. Saying a high $r$ or $r^2$ shows a linear model is right: only the residual plot shows that.

探索

最佳拟合的最小二乘直线

使竖直间隙平方总和最小的那条线。

词汇 训练
English 中文 拼音
coefficient of determination/ˌkəʊɪˈfɪʃənt ɒv dɪˌtɜːmɪˈneɪʃn/ 决定系数 jué dìng xì shù
2.9

分析偏离线性的情况

教学大纲

**持久理解 (DAT-1):**回归模型可以使我们根据解释变量的变化来预测响应。

**学习目标 DAT-1.I:**识别回归中的强影响点。[技能 2.A]

  • DAT-1.I.1 回归中的离群点是指不遵循数据其余部分所示总体趋势的点,且在计算最小二乘回归线(LSRL)时具有较大的残差。
  • DAT-1.I.2 回归中的高杠杆点是指其 $x$ 值显著大于或小于其他观测值的点。
  • DAT-1.I.3 回归中的强影响点是指任何若被移除则会显著改变关系的点。示例包括斜率、$y$ 截距和/或相关系数发生明显变化。离群点和高杠杆点通常都是强影响点。

**学习目标 DAT-1.J:**利用最小二乘回归线计算经过变换的数据集的预测响应。[技能 2.C]

  • DAT-1.J.1 变量的变换,例如对响应变量的每个值取自然对数或对解释变量的每个值进行平方,可用于创建变换后的数据集,其形式可能比未变换的数据更具线性特征。
  • DAT-1.J.2 数据变换后残差图中随机性增加和/或 $r^2$ 向更接近 1 的值移动,提供了证据表明:对于变换后的数据,最小二乘回归线是比未变换数据的回归线更合适的模型,用于根据解释变量预测响应。

来源:College Board AP 课程与考试说明

English

Some points strongly affect the line. A high-leverage 高杠杆 point has an extreme $x$-value; an influential 有影响的 point noticeably changes the slope or $r$ when removed; an outlier here is a point with a large residual. When the pattern is curved, transform a variable (e.g. take a log) to straighten it, then fit a line to the transformed data.

探索

一个有影响力的点撬动直线

一个远在外侧、偏离趋势的点能让整条线倾斜。

词汇 训练
English 中文 拼音
high-leverage/haɪ ˈliːvərɪdʒ/ 高杠杆 gāo gàng gǎn
influential/ˌɪnfluːˈenʃl/ 有影响的 yǒu yǐng xiǎng de
2.9

Practice

English

Answer each before reading the answers below.

  1. Of 120 students, 50 play a sport, and 30 of those 50 are also in a music group. What proportion of sport players are in a music group?
  2. A scatterplot of hours slept against reaction time gives $r=-0.85$. Describe the relationship.
  3. A regression line is $\hat y=12+2.5x$. Predict $y$ when $x=8$, and find the residual for a point $(8,\ 29)$.
  4. The data in question 3 have $x$ values from 0 to 10. Why is predicting $y$ at $x=40$ risky?
  5. A student says: “The correlation is $0.9$, so $x$ causes $y$.” Correct the student.
2.9

答案

English
  1. $30/50=0.60$. This is a conditional proportion: it uses only the sport players as the whole.
  2. A strong, negative, linear relationship: students who sleep more tend to have shorter reaction times.
  3. $\hat y=12+2.5(8)=32$. Residual $=y-\hat y=29-32=-3$; the point lies 3 units below the line.
  4. That is extrapolation: the pattern is known only for $x$ from 0 to 10, and nothing guarantees it continues to 40.
  5. Correlation measures the strength of a linear association, not causation. A lurking variable could drive both, or the link could run the other way. Only a randomized experiment supports a cause-and-effect claim.
2.9

考试技巧

English
  • On a scatterplot describe direction, form, strength, and outliers; $r$ ranges $-1$ to $1$.
  • Correlation is not causation — a lurking variable can drive both.
  • Interpret the slope of the least-squares line in context (“per one unit of $x$, predicted $y$ changes by $b$”).
  • Check a residual plot: no pattern means a line fits; a curve means it does not. Avoid extrapolation.
  • $r^2$ is the fraction of variation in $y$ explained by the model.

该知识点的互动课程

逐步完成,配合即时检查练习。

历年真题

更多 AP 统计学 知识点

登录或创建账户

IGCSE, A-Level & AP