Unit 12: Inference for Regression
Carry inference to the slope of a regression line: the sampling distribution of the slope, conditions, confidence intervals, t tests and reading computer output.
单元 12:回归的推断
把推断推广到回归直线的斜率:斜率的抽样分布、适用条件、置信区间、t 检验与计算机输出的解读。
Each topic gives objectives, an explanation, worked examples, an exam tip, common mistakes and check questions with answers. Use the contents list to jump to a topic, then finish with the unit quiz. All data are synthetic illustrations.
每个主题含学习目标、讲解、例题、考试提示、常见错误与带答案的自测题。可用目录跳转到任一主题,最后完成单元自测。所有数据均为合成示例。
Sampling Distributions for the Slope斜率的抽样分布
- Distinguish the population slope $\beta$ from the sample slope $b$, and explain that $b$ varies from sample to sample.
- Describe the sampling distribution of $b$: its centre, its spread $SE_b$ and its shape.
- Calculate the standard error of the slope $SE_b = \dfrac{s}{s_x\sqrt{n-1}}$ from summary statistics and explain why the degrees of freedom are $n-2$.
- State the four LINE conditions (Linear, Independent, Normal, Equal variance) and say which display checks each.
- Explain how sample size, scatter about the line and the spread of $x$ change $SE_b$.
- 区分总体斜率 $\beta$ 与样本斜率 $b$,并解释 $b$ 会随样本而变。
- 描述 $b$ 的抽样分布:中心、离散程度 $SE_b$ 与形状。
- 由汇总统计量计算斜率的标准误 $SE_b = \dfrac{s}{s_x\sqrt{n-1}}$,并解释自由度为何是 $n-2$。
- 写出 LINE 四个条件(线性、独立、正态、等方差)并说明各用哪种图形检查。
- 解释样本量、围绕直线的散布以及 $x$ 的离散程度如何改变 $SE_b$。
Earlier you fitted a least-squares line to the points in a scatterplot and described those points. Inference asks a larger question: if the points are a random sample from a big population, what does the line say about the whole population? The answer begins with a model. For each value of $x$, the response $y$ varies around a mean that depends linearly on $x$. The line of those means, $\mu_y = \alpha + \beta x$, is the population regression line, and its slope $\beta$ is the population slope. Individual values scatter about it: $y = \alpha + \beta x + \varepsilon$, where the random departures $\varepsilon$ are Normal with mean 0 and the same standard deviation $\sigma$ at every $x$.
此前你对散点图中的点拟合最小二乘直线,并描述这些点。推断提出更大的问题:如果这些点是大总体中的随机样本,这条直线对整个总体说明了什么?答案从模型开始。对每个 $x$ 值,响应变量 $y$ 围绕一个随 $x$ 线性变化的均值波动。这些均值构成的直线 $\mu_y = \alpha + \beta x$ 是总体回归直线(population regression line),其斜率 $\beta$ 是总体斜率。个别观测围绕它散布:$y = \alpha + \beta x + \varepsilon$,随机偏差 $\varepsilon$ 服从均值为 0 的正态分布,且在每个 $x$ 处标准差同为 $\sigma$。
The sample gives us estimates, and a sample statistic differs from the parameter it estimates. The sample slope $b$ (written $b_1$ in some books) estimates $\beta$, the intercept $a$ estimates $\alpha$, the residual standard deviation $s$ estimates $\sigma$, and the sample correlation $r$ estimates the population correlation $\rho$.
样本给出估计值,而样本统计量与它所估计的参数并不相同。样本斜率 $b$(有些教材写作 $b_1$)估计 $\beta$,截距 $a$ 估计 $\alpha$,残差标准差 $s$ 估计 $\sigma$,样本相关系数 $r$ 估计总体相关系数 $\rho$。
| Population parameter | Sample statistic | Meaning |
|---|---|---|
| $\beta$ | $b$ | slope: change in mean $y$ per one-unit increase in $x$ |
| $\alpha$ | $a$ | intercept: mean $y$ when $x=0$ |
| $\sigma$ | $s$ | standard deviation of the points about the line |
| $\rho$ | $r$ | strength and direction of the linear association |
| 总体参数 | 样本统计量 | 含义 |
|---|---|---|
| $\beta$ | $b$ | 斜率:$x$ 每增加一个单位,$y$ 的均值的变化量 |
| $\alpha$ | $a$ | 截距:$x=0$ 时 $y$ 的均值 |
| $\sigma$ | $s$ | 各点围绕直线的标准差 |
| $\rho$ | $r$ | 线性关联的强度与方向 |
The data behind Figure 9.1 are below. They are illustrative, not a real study: 15 students chosen at random from a school of 1,200, with $x$ the hours of study per week and $y$ the score on a 100-point test.
图 9.1 背后的数据如下。它们是示例数据,不是真实研究:从一所有 1,200 名学生的学校随机抽取 15 名学生,$x$ 为每周学习小时数,$y$ 为百分制测验分数。
| Hours $x$ | 2 | 3 | 4 | 5 | 5 | 6 | 7 | 7 | 8 | 9 | 10 | 10 | 11 | 12 | 13 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Score $y$ | 55 | 66 | 57 | 70 | 60 | 68 | 66 | 77 | 69 | 75 | 80 | 72 | 84 | 81 | 88 |
| 小时数 $x$ | 2 | 3 | 4 | 5 | 5 | 6 | 7 | 7 | 8 | 9 | 10 | 10 | 11 | 12 | 13 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 分数 $y$ | 55 | 66 | 57 | 70 | 60 | 68 | 66 | 77 | 69 | 75 | 80 | 72 | 84 | 81 | 88 |
The sampling distribution of the sample slope样本斜率的抽样分布
Take another random sample of 15 students and the points change, so the least-squares line and the slope $b$ change too. If we could repeat the sampling many times, the values of $b$ would form the sampling distribution of $b$. Three facts describe it when the LINE conditions hold. Centre: the mean of the sample slopes is $\beta$, so $b$ is an unbiased estimator. Spread: the typical distance between $b$ and $\beta$ is measured by the standard deviation of $b$, which we estimate with the standard error of the slope $SE_b$. Shape: Normal when the errors are Normal; because $\sigma$ must be estimated by $s$, the standardized slope follows a $t$ distribution instead of a Normal one.
再随机抽取 15 名学生,数据点就变了,最小二乘直线与斜率 $b$ 也随之改变。若能反复抽样,这些 $b$ 值就构成 $b$ 的抽样分布(sampling distribution)。当 LINE 条件成立时,它有三个特征。中心:样本斜率的均值是 $\beta$,所以 $b$ 是无偏估计量。离散程度:$b$ 与 $\beta$ 的典型距离由 $b$ 的标准差衡量,我们用斜率的标准误 $SE_b$ 来估计它。形状:误差服从正态时为正态;由于必须用 $s$ 估计 $\sigma$,标准化后的斜率服从 $t$ 分布而不是正态分布。
$$SE_b = \dfrac{s}{s_x\sqrt{n-1}}, \qquad s = \sqrt{\dfrac{\sum (y_i - \hat{y}_i)^2}{n-2}}$$
Here $s_x$ is the standard deviation of the $x$-values and $n$ is the number of points. The residual standard deviation $s$ divides by $n-2$ because two numbers, $a$ and $b$, were estimated from the data before the residuals were found. That is why inference for a slope uses a $t$ distribution with $df = n-2$.
$$SE_b = \dfrac{s}{s_x\sqrt{n-1}}, \qquad s = \sqrt{\dfrac{\sum (y_i - \hat{y}_i)^2}{n-2}}$$
其中 $s_x$ 是 $x$ 值的标准差,$n$ 是数据点个数。残差标准差 $s$ 除以 $n-2$,是因为求残差之前已经由数据估计了 $a$ 和 $b$ 两个数。所以斜率推断使用自由度 $df = n-2$ 的 $t$ 分布。
The formula shows three ways to get a more precise estimate of $\beta$ (a smaller $SE_b$): points closer to the line (smaller $s$), $x$-values spread over a wider range (larger $s_x$), and a larger sample (larger $n$).
公式说明了三种得到更精确的 $\beta$ 估计(更小的 $SE_b$)的途径:点更靠近直线($s$ 更小)、$x$ 值分布范围更宽($s_x$ 更大)、样本更大($n$ 更大)。
Conditions for inference: LINE推断的条件:LINE
The $t$ procedures for a slope are valid only when the model behind them is reasonable. Remember them as LINE.
斜率的 $t$ 程序只有在其背后的模型合理时才有效。记作 LINE。
| Condition | What it says | How to check |
|---|---|---|
| Linear | The true relationship between mean $y$ and $x$ is linear | Scatterplot looks roughly linear; residual plot shows no curved pattern |
| Independent | Observations do not influence one another | Random sample or randomized experiment; if sampling without replacement, $n$ is less than 10% of the population (10% condition) |
| Normal | For each $x$, the $y$-values (equivalently the residuals) vary Normally about the line | Dotplot, histogram or Normal probability plot of the residuals is roughly symmetric or straight with no strong skew or outliers |
| Equal variance | The standard deviation of $y$ about the line is the same at every $x$ | Residual plot has about the same vertical spread from left to right (no fan shape) |
| 条件 | 含义 | 如何检查 |
|---|---|---|
| Linear(线性) | $y$ 的均值与 $x$ 的真实关系是线性的 | 散点图大致呈线性;残差图没有弯曲模式 |
| Independent(独立) | 各观测互不影响 | 随机样本或随机化实验;若为不放回抽样,$n$ 小于总体的 10%(10% 条件) |
| Normal(正态) | 对每个 $x$,$y$ 值(等价地,残差)围绕直线呈正态变化 | 残差的点图、直方图或正态概率图大致对称或呈直线,无明显偏斜或离群点 |
| Equal variance(等方差) | 在每个 $x$ 处,$y$ 围绕直线的标准差相同 | 残差图从左到右的纵向散布大致相同(不呈扇形) |
Notice that Normality is about the residuals (the vertical scatter about the line), not about the $x$ values or the $y$ values on their own. Section 9.4 shows how to check each condition from plots, and Figure 9.4 there shows the three residual-plot patterns you must recognize.
注意,正态性针对的是残差(围绕直线的纵向散布),而不是 $x$ 值或 $y$ 值本身。9.4 节说明如何用图形检查各条件,那里的图 9.4 展示了你必须会辨认的三种残差图模式。
Worked Example: identify the parameter and the statistic in context例题:在情境中识别参数与统计量
Using the 15 students above, the least-squares line is $\hat{y} = 51.66 + 2.617x$.
- Population and sample: the population is all 1,200 students at the school; the sample is the 15 students chosen at random.
- Parameter: $\beta$ is the slope of the population regression line, that is, the true mean change in test score (points) for each additional hour of weekly study among all students at the school. It is fixed and unknown.
- Statistic: the sample slope is $b = 2.617$ points per hour. It estimates $\beta$.
- In context: in this sample, each additional hour of weekly study goes with a predicted increase of about 2.62 points in test score. A different random sample of 15 students would give a different $b$, which is why we need the sampling distribution of $b$ before we can make a statement about $\beta$.
用上面 15 名学生的数据,最小二乘直线为 $\hat{y} = 51.66 + 2.617x$。
- 总体与样本:总体是该校全部 1,200 名学生;样本是随机抽取的 15 名学生。
- 参数:$\beta$ 是总体回归直线的斜率,即该校全体学生每周学习时间每多一小时,测验分数(分)的真实均值变化量。它是固定而未知的。
- 统计量:样本斜率 $b = 2.617$ 分/小时,用来估计 $\beta$。
- 结合情境:在这个样本中,每周学习时间每增加一小时,预测测验分数约增加 2.62 分。换一个 15 人的随机样本会得到不同的 $b$,所以要对 $\beta$ 作结论,必须先了解 $b$ 的抽样分布。
Worked Example: compute $b$ and $SE_b$ from summary statistics例题:由汇总统计量计算 $b$ 与 $SE_b$
For the same 15 students the summary statistics are $n=15$, $s_x = 3.335$ hours, $s_y = 9.741$ points, $r = 0.8961$ and $s = 4.486$ points. Find $b$ and $SE_b$.
- Slope: $b = r\,\dfrac{s_y}{s_x} = 0.8961 \times \dfrac{9.741}{3.335} = 2.617$ points per hour.
- Standard error: $SE_b = \dfrac{s}{s_x\sqrt{n-1}} = \dfrac{4.486}{3.335\sqrt{14}} = \dfrac{4.486}{12.479} = 0.3595$.
- Interpretation: the sample slope of 2.617 typically differs from the true slope $\beta$ by about 0.36 points per hour when we take random samples of 15 students.
Why this works: $b$ rescales the correlation by the ratio of standard deviations, and $SE_b$ measures the scatter of the points about the line ($s$) relative to the spread of the $x$-values and the number of points.
仍是这 15 名学生,汇总统计量为 $n=15$,$s_x = 3.335$ 小时,$s_y = 9.741$ 分,$r = 0.8961$,$s = 4.486$ 分。求 $b$ 与 $SE_b$。
- 斜率:$b = r\,\dfrac{s_y}{s_x} = 0.8961 \times \dfrac{9.741}{3.335} = 2.617$ 分/小时。
- 标准误:$SE_b = \dfrac{s}{s_x\sqrt{n-1}} = \dfrac{4.486}{3.335\sqrt{14}} = \dfrac{4.486}{12.479} = 0.3595$。
- 解释:对 15 名学生的随机样本,样本斜率 2.617 与真实斜率 $\beta$ 的典型差距约为 0.36 分/小时。
为何成立:$b$ 用标准差之比对相关系数重新定标;$SE_b$ 则衡量各点围绕直线的散布($s$)相对于 $x$ 值的离散程度与点数的大小。
Worked Example: how sample size changes $SE_b$, and the independence check例题:样本量如何改变 $SE_b$,以及独立性检查
Suppose a second study of the same school takes 60 students instead of 15 and finds the same $s = 4.486$ and $s_x = 3.335$.
- $SE_b = \dfrac{4.486}{3.335\sqrt{59}} = \dfrac{4.486}{25.617} = 0.1751$.
- Compare with 0.3595: quadrupling $n$ cuts $SE_b$ roughly in half, because $SE_b$ shrinks like $1/\sqrt{n-1}$ ($\sqrt{14/59} \approx 0.49$).
- Independence: the students were chosen at random and 60 is less than 10% of 1,200 (which is 120), so the 10% condition holds. The same check passes for $n = 15$.
Why this works: a larger sample averages out more of the chance scatter, so sample slopes cluster more tightly around $\beta$.
假设对该校做第二项研究,抽取 60 名而不是 15 名学生,得到相同的 $s = 4.486$ 与 $s_x = 3.335$。
- $SE_b = \dfrac{4.486}{3.335\sqrt{59}} = \dfrac{4.486}{25.617} = 0.1751$。
- 与 0.3595 比较:$n$ 增为 4 倍,$SE_b$ 约减半,因为 $SE_b$ 随 $1/\sqrt{n-1}$ 缩小($\sqrt{14/59} \approx 0.49$)。
- 独立性:学生为随机抽取,且 60 小于 1,200 的 10%(即 120),所以 10% 条件成立;对 $n = 15$ 同样通过。
为何成立:样本越大,越能抵消偶然的散布,样本斜率就越紧密地聚集在 $\beta$ 附近。
Always define $\beta$ in words with the population attached: "the true slope of the population regression line relating mean test score to weekly study hours for all students at this school." A bare "the slope" is incomplete, and a statement about $b$ where the question asks about $\beta$ is a statement about the wrong thing.
一定要用文字定义 $\beta$ 并写明总体:“该校全体学生中,平均测验分数与每周学习小时数之间总体回归直线的真实斜率。”只写“斜率”不完整;题目问 $\beta$ 时却写 $b$,就是答非所问。
- Writing hypotheses or intervals about $b$. Inference is about the parameter $\beta$; $b$ is the known statistic that estimates it.
- Using $n-1$ degrees of freedom (the one-sample $t$ value). For a slope, $df = n-2$.
- Checking Normality on the $y$-values alone. The condition is on the residuals, the scatter about the line.
- 对 $b$ 写假设或区间。推断针对参数 $\beta$;$b$ 是已知的、用来估计它的统计量。
- 使用 $n-1$ 自由度(单样本 $t$ 的值)。斜率推断的自由度是 $df = n-2$。
- 只对 $y$ 值单独检查正态性。条件针对的是残差,即围绕直线的散布。
A random sample of 40 houses gives the line $\hat{y} = 12.5 + 0.08x$ for price against floor area. Is 0.08 a parameter or a statistic, and which symbol stands for the matching parameter?40 栋房屋的随机样本得到价格对建筑面积的直线 $\hat{y} = 12.5 + 0.08x$。0.08 是参数还是统计量?对应的参数用哪个符号表示?
A statistic: it is computed from a sample. It is the sample slope $b$, and the parameter it estimates is the population slope $\beta$.
是统计量:它由样本算出,是样本斜率 $b$;它所估计的参数是总体斜率 $\beta$。
Why does inference for a slope use $n-2$ degrees of freedom?为什么斜率的推断使用 $n-2$ 个自由度?
Two values, the intercept $a$ and the slope $b$, are estimated from the data before the residuals are calculated, so only $n-2$ of the residuals are free to vary.
在计算残差之前,已由数据估计了截距 $a$ 与斜率 $b$ 两个值,所以只有 $n-2$ 个残差可以自由变化。
Calculate $SE_b$ when $s = 3.2$, $s_x = 2.5$ and $n = 26$.当 $s = 3.2$,$s_x = 2.5$,$n = 26$ 时,计算 $SE_b$。
$SE_b = \dfrac{3.2}{2.5\sqrt{25}} = \dfrac{3.2}{12.5} = 0.256$.
$SE_b = \dfrac{3.2}{2.5\sqrt{25}} = \dfrac{3.2}{12.5} = 0.256$。
Two researchers study the same relationship with the same $n$ and the same $s$. One uses $x$-values from 0 to 20 and the other only from 8 to 12. Whose slope estimate is more precise, and why?两位研究者以相同的 $n$ 和相同的 $s$ 研究同一关系。一位的 $x$ 值取自 0 到 20,另一位只取 8 到 12。谁的斜率估计更精确?为什么?
The researcher using 0 to 20. A wider spread of $x$ gives a larger $s_x$ in the denominator of $SE_b$, so $SE_b$ is smaller and the slope is estimated more precisely.
取 0 到 20 的研究者。$x$ 分布越宽,$SE_b$ 分母中的 $s_x$ 越大,$SE_b$ 越小,斜率估计越精确。
Confidence Intervals for the Slope斜率的置信区间
- Write the formula for a $t$-interval for the slope, $b \pm t^* \cdot SE_b$, with $df = n-2$.
- Read the coefficient, SE Coef, T, P, $S$ and R-Sq entries of regression computer output.
- Calculate a confidence interval for $\beta$ by hand from computer output and with the TI-84 LinRegTInt.
- Interpret a confidence interval for a slope in context, including the units and the phrase "per additional".
- Explain how the confidence level changes the width of the interval.
- 写出斜率的 $t$ 区间公式 $b \pm t^* \cdot SE_b$,其中 $df = n-2$。
- 读懂回归计算机输出中的 Coef、SE Coef、T、P、$S$ 与 R-Sq。
- 由计算机输出手算 $\beta$ 的置信区间,并用 TI-84 的 LinRegTInt 求得。
- 结合情境解释斜率的置信区间,包括单位与“每增加一个单位”的说法。
- 解释置信水平如何改变区间的宽度。
Because the standardized slope follows a $t$ distribution with $n-2$ degrees of freedom when the LINE conditions hold, a confidence interval for $\beta$ has the familiar form statistic plus or minus critical value times standard error. This is the t-interval for the slope.
当 LINE 条件成立时,标准化后的斜率服从自由度为 $n-2$ 的 $t$ 分布,所以 $\beta$ 的置信区间采用熟悉的形式:统计量 加减 临界值乘标准误。这就是斜率的 t 区间(t-interval for the slope)。
$$b \pm t^* \cdot SE_b, \qquad df = n-2$$
$t^*$ is the critical value of the $t$ distribution with $n-2$ degrees of freedom that leaves the middle $C\%$ of the area. Find it with a table or with invT on the calculator.
$$b \pm t^* \cdot SE_b, \qquad df = n-2$$
$t^*$ 是自由度为 $n-2$ 的 $t$ 分布中使中间 $C\%$ 面积的临界值。可查表,或用计算器的 invT 求得。
Reading regression computer output读懂回归计算机输出
Problems often supply regression computer output instead of raw data. Here is the output for the 15 students of Topic 12.1, with study hours as the explanatory variable.
题目常常给出回归计算机输出(computer output)而不是原始数据。下面是 9.1 节 15 名学生的输出,学习小时数为解释变量。
| Predictor | Coef | SE Coef | T | P |
|---|---|---|---|---|
| Constant | 51.66 | 2.923 | 17.67 | 0.000 |
| Hours | 2.6173 | 0.3595 | 7.28 | 0.000 |
S = 4.4858 R-Sq = 80.3% R-Sq(adj) = 78.8%
| Predictor | Coef | SE Coef | T | P |
|---|---|---|---|---|
| Constant | 51.66 | 2.923 | 17.67 | 0.000 |
| Hours | 2.6173 | 0.3595 | 7.28 | 0.000 |
S = 4.4858 R-Sq = 80.3% R-Sq(adj) = 78.8%
- The row labelled Constant is the intercept:
Coefis $a$ andSE Coefis its standard error. The row labelled Hours is the slope:Coef$= b = 2.6173$ andSE Coef$= SE_b = 0.3595$. Tis the coefficient divided by its standard error, andPis the two-sided $p$-value for testing that the true coefficient is 0 (Topic 12.5). Other software may name the columns Estimate, Std. Error, t value and Pr(>|t|).S$= s = 4.4858$ is the standard deviation of the residuals: a typical vertical distance between a student's actual score and the score the line predicts.R-Sq$= r^2 = 80.3\%$: about 80.3% of the variation in test scores is accounted for by the linear relationship with study hours. The correlation is $r = +0.896$, positive because the slope is positive.
- 标有 Constant 的行是截距:
Coef是 $a$,SE Coef是它的标准误。标有 Hours 的行是斜率:Coef$= b = 2.6173$,SE Coef$= SE_b = 0.3595$。 T是系数除以其标准误;P是检验真实系数为 0 的双侧 $p$ 值(见 9.5 节)。其他软件可能把这些列叫作 Estimate、Std. Error、t value 与 Pr(>|t|)。S$= s = 4.4858$ 是残差的标准差:学生实际分数与直线预测分数之间的典型纵向距离。R-Sq$= r^2 = 80.3\%$:测验分数变异中约 80.3% 可由与学习小时数的线性关系解释。相关系数为 $r = +0.896$,因斜率为正而取正。
Worked Example: read the computer output例题:读计算机输出
Use the output above to answer (a) to (e).
- (a) Equation: $\hat{y} = 51.66 + 2.6173x$, where $x$ is hours of study per week and $\hat{y}$ is the predicted test score in points.
- (b) Slope: $b = 2.6173$ points per hour, from the
Coefentry in the Hours row. - (c) Standard error of the slope: $SE_b = 0.3595$, from
SE Coef. - (d) Check T: $T = \dfrac{2.6173}{0.3595} = 7.28$, which matches the output.
- (e) Standard deviation of the residuals: $s = 4.49$ points; $r^2 = 80.3\%$.
Why this works: every number in the output is built from the same ingredients $b$, $SE_b$ and $s$ that you met in Topic 12.1.
用上面的输出回答 (a) 至 (e)。
- (a) 方程:$\hat{y} = 51.66 + 2.6173x$,其中 $x$ 为每周学习小时数,$\hat{y}$ 为预测测验分数(分)。
- (b) 斜率:$b = 2.6173$ 分/小时,取自 Hours 行的
Coef。 - (c) 斜率的标准误:$SE_b = 0.3595$,取自
SE Coef。 - (d) 验证 T:$T = \dfrac{2.6173}{0.3595} = 7.28$,与输出一致。
- (e) 残差标准差:$s = 4.49$ 分;$r^2 = 80.3\%$。
为何成立:输出中每个数都由 9.1 节的 $b$、$SE_b$ 与 $s$ 这些要素构成。
Worked Example: a 95% confidence interval for the slope例题:斜率的 95% 置信区间
Construct and interpret a 95% confidence interval for $\beta$ from the output. The conditions are checked in Topic 12.4 and are assumed to hold here.
- Name the procedure: a $t$-interval for the slope of the population regression line.
- Degrees of freedom: $df = n-2 = 15-2 = 13$. For 95% confidence,
invT(0.975, 13)gives $t^* = 2.160$. - Margin of error: $t^* \cdot SE_b = 2.160 \times 0.3595 = 0.777$.
- Interval: $2.6173 \pm 0.777$, that is $(1.84,\ 3.39)$.
- Conclusion in context: we are 95% confident that the interval from 1.84 to 3.39 captures the true slope of the population regression line. That is, for all students at this school, each additional hour of weekly study is associated with an increase in mean test score of between 1.84 and 3.39 points.
由输出构造并解释 $\beta$ 的 95% 置信区间。条件在 9.4 节检查,此处假定成立。
- 说明程序:总体回归直线斜率的 $t$ 区间。
- 自由度:$df = n-2 = 15-2 = 13$。95% 置信度下,
invT(0.975, 13)给出 $t^* = 2.160$。 - 误差范围:$t^* \cdot SE_b = 2.160 \times 0.3595 = 0.777$。
- 区间:$2.6173 \pm 0.777$,即 $(1.84,\ 3.39)$。
- 结合情境的结论:我们有 95% 的把握认为,从 1.84 到 3.39 的区间覆盖了总体回归直线的真实斜率。也就是说,对该校全体学生而言,每周学习时间每多一小时,平均测验分数约增加 1.84 到 3.39 分。
Worked Example: how the confidence level changes the interval例题:置信水平如何改变区间
Keep $b = 2.6173$ and $SE_b = 0.3595$ with $df = 13$ and change only the confidence level.
- 90%: $t^* = 1.771$, interval $(1.98,\ 3.25)$.
- 95%: $t^* = 2.160$, interval $(1.84,\ 3.39)$.
- 99%: $t^* = 3.012$, interval $(1.53,\ 3.70)$.
Why this works: to be more confident that the method captures $\beta$ you must cast a wider net, so a larger $t^*$ makes a wider interval. The price of extra confidence is less precision.
保持 $b = 2.6173$、$SE_b = 0.3595$、$df = 13$ 不变,只改变置信水平。
- 90%:$t^* = 1.771$,区间 $(1.98,\ 3.25)$。
- 95%:$t^* = 2.160$,区间 $(1.84,\ 3.39)$。
- 99%:$t^* = 3.012$,区间 $(1.53,\ 3.70)$。
为何成立:想更有把握地覆盖 $\beta$,就得撒更大的网,所以更大的 $t^*$ 带来更宽的区间。多一分把握的代价是精度降低。
Worked Example: LinRegTInt on the TI-84例题:在 TI-84 上使用 LinRegTInt
Find the same interval from the raw data on a TI-84.
- Press
STAT, choose1:Edit, and enter the hours inL1and the scores inL2. - Press
STAT, press the right arrow to reachTESTS, and chooseLinRegTInt. (Older operating systems do not have it; then useLinRegTTestto get $b$ and $SE_b$ and apply the formula.) - Enter
Xlist: L1,Ylist: L2,Freq: 1,C-Level: 0.95, leaveRegEQblank, and chooseCalculate. - The screen shows the interval $(1.8407,\ 3.3939)$, $b = 2.6173$, $df = 13$, $s = 4.4858$, $a = 51.6575$, $r^2 = 0.8031$ and $r = 0.8961$.
Write the interval and the interpretation from the previous example in your answer. A bare calculator screen does not show that you know what the interval means, and you must still say which procedure you used.
在 TI-84 上由原始数据求同一区间。
- 按
STAT,选1:Edit,把小时数输入L1,分数输入L2。 - 按
STAT,按右方向键移到TESTS,选LinRegTInt。(较旧的操作系统没有该功能;此时用LinRegTTest得到 $b$ 与 $SE_b$ 再套公式。) - 输入
Xlist: L1、Ylist: L2、Freq: 1、C-Level: 0.95,RegEQ留空,选Calculate。 - 屏幕显示区间 $(1.8407,\ 3.3939)$、$b = 2.6173$、$df = 13$、$s = 4.4858$、$a = 51.6575$、$r^2 = 0.8031$ 与 $r = 0.8961$。
作答时要写出区间并像上一道例题那样解释。仅有计算器屏幕不能证明你懂得区间的含义,你还必须说明所用的程序。
A complete interpretation names four things: the confidence level, the interval with units, the parameter in context (the true slope, or the true mean change in $y$ for each additional unit of $x$) and the population. Say "mean" or "average": the slope describes how the mean response changes, not how every individual changes. Also state which procedure you used and that its conditions were checked.
完整的解释要写出四点:置信水平、带单位的区间、结合情境的参数(真实斜率,或 $x$ 每增加一个单位时 $y$ 的真实平均变化)以及总体。要说“平均”:斜率描述的是响应的均值如何变化,而不是每个个体怎样变化。还要说明所用程序并交代条件已检查。
- Saying "there is a 95% probability that $\beta$ is in the interval." $\beta$ is fixed; the 95% describes how often the method captures it over many samples.
- Saying "95% of students gain between 1.84 and 3.39 points per hour." The interval is about the mean slope, not about individual students.
- Using the standard deviation $s$ where the standard error $SE_b$ belongs, or using $z^*$ instead of $t^*$.
- Using the line to predict far outside the $x$-values in the sample (extrapolation). The interval and the model only describe the range of $x$ that was observed.
- 说“$\beta$ 在区间内的概率为 95%”。$\beta$ 是固定的;95% 描述的是方法在多次抽样中覆盖它的比例。
- 说“95% 的学生每小时增加 1.84 到 3.39 分”。区间针对的是平均斜率,而不是个别学生。
- 把应当用标准误 $SE_b$ 的地方用成标准差 $s$,或用 $z^*$ 代替 $t^*$。
- 用这条直线去预测样本 $x$ 取值范围之外很远处的结果(外推)。区间与模型只描述已观测到的 $x$ 范围。
Regression output for $n = 22$ reports Coef $= 0.0842$ and SE Coef $= 0.0211$ for the explanatory variable. Calculate a 95% confidence interval for the slope.$n = 22$ 的回归输出中,解释变量的 Coef $= 0.0842$,SE Coef $= 0.0211$。计算斜率的 95% 置信区间。
$df = 22-2 = 20$, so $t^* = 2.086$. The margin of error is $2.086 \times 0.0211 = 0.0440$, giving $0.0842 \pm 0.0440$, that is $(0.0402,\ 0.1282)$.
$df = 22-2 = 20$,故 $t^* = 2.086$。误差范围为 $2.086 \times 0.0211 = 0.0440$,区间为 $0.0842 \pm 0.0440$,即 $(0.0402,\ 0.1282)$。
Without calculating, which is wider for the same data: a 90% interval or a 99% interval for the slope? Explain.不作计算,对同一组数据,斜率的 90% 区间与 99% 区间哪个更宽?请解释。
The 99% interval. A higher confidence level needs a larger critical value $t^*$, so the margin of error $t^* \cdot SE_b$ is larger.
99% 区间更宽。更高的置信水平需要更大的临界值 $t^*$,误差范围 $t^* \cdot SE_b$ 就更大。
In the computer output above, what does $S = 4.4858$ tell you, and how is it different from $SE_b = 0.3595$?在上面的计算机输出中,$S = 4.4858$ 说明什么?它与 $SE_b = 0.3595$ 有何不同?
$S$ is the standard deviation of the residuals: a typical distance of a student's actual score from the line, about 4.5 points. $SE_b$ is the typical error in the slope estimate from sample to sample, about 0.36 points per hour.
$S$ 是残差的标准差:学生实际分数与直线的典型距离,约 4.5 分。$SE_b$ 是不同样本之间斜率估计的典型误差,约 0.36 分/小时。
A student writes: "There is a 95% probability that the true slope is between 1.84 and 3.39." Correct the statement.一名学生写道:“真实斜率在 1.84 与 3.39 之间的概率为 95%。”请改正。
The true slope $\beta$ is a fixed number, so it is either in the interval or not. Write: "We are 95% confident that the interval from 1.84 to 3.39 captures the true slope," and add the context (mean increase in score per additional hour of study).
真实斜率 $\beta$ 是固定的数,要么在区间内,要么不在。应写:“我们有 95% 的把握认为从 1.84 到 3.39 的区间覆盖了真实斜率”,并补充情境(每多学一小时,平均分数的增加量)。
Justifying a Claim About a Slope论证关于斜率的说法
- Explain why a slope of 0 means no linear relationship between $x$ and $y$ in the population.
- Use a confidence interval for $\beta$ to decide whether there is convincing evidence of a linear relationship.
- Justify a claim about the value of the slope by checking whether the claimed value lies inside the interval.
- Link the confidence level $C$ of a two-sided interval to the significance level $\alpha = 1 - C$ of a two-sided test.
- Write a conclusion that avoids "no relationship" when the interval contains 0.
- 解释为什么总体斜率为 0 意味着 $x$ 与 $y$ 之间没有线性关系。
- 用 $\beta$ 的置信区间判断是否有令人信服的证据表明存在线性关系。
- 检查所声称的值是否落在区间内,从而论证关于斜率取值的说法。
- 把双侧区间的置信水平 $C$ 与双侧检验的显著性水平 $\alpha = 1 - C$ 联系起来。
- 当区间含 0 时,写出不使用“没有关系”的结论。
The interval from Topic 12.2 does more than estimate $\beta$. It lists the values of the slope that are plausible given the data, so we can use it to judge a claim about the slope. The most important value to check is zero. If $\beta = 0$, the population regression line is flat: the mean of $y$ does not change as $x$ changes, which means there is no linear relationship (no linear association) between $x$ and $y$ in the population.
9.2 节的区间不只是估计 $\beta$。它列出了在这组数据下斜率合理的取值,因此可以用来判断关于斜率的说法(claim)。最重要的检查值是零。如果 $\beta = 0$,总体回归直线是水平的:$x$ 变化时 $y$ 的均值不变,这意味着总体中 $x$ 与 $y$ 之间没有线性关系(线性关联)。
- The interval does not contain 0: 0 is not a plausible value, so there is convincing evidence of a linear relationship. The sign of the endpoints gives the direction.
- The interval contains 0 (it includes 0): 0 is plausible, so there is not convincing evidence of a linear relationship. This does not prove that the slope is 0.
- 区间不含 0:0 不是合理取值,所以有令人信服的证据表明存在线性关系。端点的符号给出方向。
- 区间含 0:0 是合理取值,所以没有令人信服的证据表明存在线性关系。这并不证明斜率等于 0。
A two-sided interval and a two-sided test give the same decision. A $C\%$ interval that excludes 0 matches rejecting $H_0\!: \beta = 0$ at significance level $\alpha = 1 - C$ (a 95% interval goes with $\alpha = 0.05$). A one-sided test at $\alpha = 0.05$ matches a 90% two-sided interval, provided the sign of the estimate agrees with the alternative.
双侧区间与双侧检验给出相同的决定。不含 0 的 $C\%$ 区间,对应在显著性水平 $\alpha = 1 - C$ 下拒绝 $H_0\!: \beta = 0$(95% 区间对应 $\alpha = 0.05$)。在 $\alpha = 0.05$ 下的单侧检验对应 90% 双侧区间,前提是估计值的符号与备择假设一致。
The same logic works for any claimed value, not just 0. A claim that $\beta$ equals some number is consistent with the data if that number lies inside the interval, and it is contradicted if the number lies outside.
同样的逻辑适用于任何被声称的值,不只是 0。如果某个数落在区间内,则“$\beta$ 等于该数”的说法与数据相符;如果落在区间外,则说法被数据否定。
Worked Example: an interval that contains 0例题:含 0 的区间
A random sample of 10 students reports weekly hours of background music while studying ($x$, from 1 to 10) and a score $y$ out of 20 on a vocabulary quiz. The 10 pairs are illustrative. The sample slope is $b = 0.2727$ points per hour with $SE_b = 0.3402$. Is there convincing evidence of a linear relationship?
- $df = 10 - 2 = 8$, and for 95% confidence $t^* = 2.306$.
- Margin of error: $2.306 \times 0.3402 = 0.784$.
- Interval: $0.2727 \pm 0.784 = (-0.512,\ 1.057)$.
- Claim justified? The interval contains 0 (it runs from a negative to a positive value). A slope of 0 is a plausible value.
- Conclusion in context: we do not have convincing evidence of a linear relationship between weekly hours of background music and vocabulary quiz score for students at this school. We cannot say there is no relationship; with only 10 students the data are simply not decisive.
10 名学生的随机样本报告了学习时每周背景音乐小时数($x$,1 到 10)与满分 20 分词汇测验的分数 $y$。这 10 对数据为示例。样本斜率 $b = 0.2727$ 分/小时,$SE_b = 0.3402$。是否有令人信服的证据表明存在线性关系?
- $df = 10 - 2 = 8$,95% 置信度下 $t^* = 2.306$。
- 误差范围:$2.306 \times 0.3402 = 0.784$。
- 区间:$0.2727 \pm 0.784 = (-0.512,\ 1.057)$。
- 说法是否成立?区间含 0(从负值延伸到正值)。斜率为 0 是合理取值。
- 结合情境的结论:我们没有令人信服的证据表明该校学生每周背景音乐小时数与词汇测验分数之间存在线性关系。但不能说“没有关系”;只有 10 名学生,数据只是不具决定性。
| Hours of music $x$ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Quiz score $y$ | 14 | 9 | 16 | 11 | 13 | 18 | 10 | 15 | 12 | 17 |
| 背景音乐小时数 $x$ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| 测验分数 $y$ | 14 | 9 | 16 | 11 | 13 | 18 | 10 | 15 | 12 | 17 |
Worked Example: judge a claim about the value of the slope例题:论证关于斜率取值的说法
Use the 95% interval $(1.84,\ 3.39)$ from Topic 12.2 for the effect of study hours on test score. (a) A tutor claims that each extra hour of weekly study raises the mean score by 3 points. (b) A website claims at least 4 points per hour. Does the interval support either claim?
- (a) 3 lies between 1.84 and 3.39, so a slope of 3 is plausible. The data do not contradict the tutor's claim, although they do not prove it either.
- (b) The whole interval is below 4 (the upper endpoint is 3.39), so 4 points per hour or more is not plausible. The data give convincing evidence against the website's claim.
- (c) The interval does not contain 0, so there is convincing evidence of a positive linear relationship between weekly study hours and test score for these students.
Why this works: the interval is the set of slopes that the data cannot rule out, so any claimed value inside it survives and any value outside it does not.
使用 9.2 节中学习时间对测验分数影响的 95% 区间 $(1.84,\ 3.39)$。(a) 一位辅导老师声称每周多学一小时使平均分数提高 3 分。(b) 一个网站声称每小时至少提高 4 分。区间是否支持这两种说法?
- (a) 3 落在 1.84 与 3.39 之间,所以斜率为 3 是合理的。数据没有否定老师的说法,当然也没有证明它。
- (b) 整个区间都低于 4(上端点为 3.39),所以每小时 4 分或更多并不合理。数据有令人信服的证据反对该网站的说法。
- (c) 区间不含 0,所以对这些学生而言,有令人信服的证据表明每周学习时间与测验分数之间存在正的线性关系。
为何成立:区间是数据无法排除的斜率集合,区间内的任何被声称的值都保留,区间外的则不保留。
Worked Example: an interval entirely below zero, with a change of units例题:完全位于零以下的区间,并转换单位
Twelve students (illustrative sample) report daily screen time $x$ in hours and nightly sleep $y$ in hours. The 95% interval for the slope is $(-0.542,\ -0.304)$ hours of sleep per additional hour of screen time. What can be claimed?
- Both endpoints are negative, so the interval does not contain 0. There is convincing evidence of a negative linear relationship between daily screen time and nightly sleep for students like these.
- Size: each additional hour of screen time goes with a decrease in mean nightly sleep of between 0.304 and 0.542 hours, about 0.3 to 0.5 hours. Converting to minutes ($\times 60$): about 18 to 33 minutes less sleep per hour of screen time.
- Cause? The students reported their own screen time, so this is an observational study. It shows an association, not that screen time causes the loss of sleep.
12 名学生(示例样本)报告每日屏幕时间 $x$(小时)与每晚睡眠 $y$(小时)。斜率的 95% 区间为 $(-0.542,\ -0.304)$ 小时睡眠/每多一小时屏幕时间。可以作出什么结论?
- 两个端点均为负,区间不含 0。对与这些学生相似的学生,有令人信服的证据表明每日屏幕时间与每晚睡眠之间存在负的线性关系。
- 大小:屏幕时间每增加一小时,每晚平均睡眠减少 0.304 到 0.542 小时之间的量,约 0.3 到 0.5 小时。换算成分钟($\times 60$):每小时屏幕时间约少睡 18 到 33 分钟。
- 因果?学生是自己报告屏幕时间的,所以这是观察研究。它显示关联,不能说明屏幕时间导致睡眠减少。
To justify a claim from an interval, write both the comparison and the decision: "The 95% interval ($-0.512$, $1.057$) contains 0, so we do not have convincing evidence of a linear relationship between ... and ... for ..." Never stop at "it contains 0", and never write "so the slope is 0" or "there is no relationship".
要用区间论证一个说法,需同时写出比较与决定:“95% 区间($-0.512$,$1.057$)含 0,所以我们没有令人信服的证据表明……与……之间对于……存在线性关系。”不要只写“含 0”,也绝不要写“所以斜率为 0”或“没有关系”。
- An interval that contains 0 means 0 is plausible, not that 0 is true. Other nonzero slopes in the interval are plausible too.
- Checking whether the estimate $b$ is far from 0 instead of whether 0 lies in the interval. Whether $b$ is large depends on $SE_b$.
- Mixing up the direction: an interval with only negative values means a negative relationship, even though the numbers have minus signs.
- 区间含 0 表示 0 是合理取值,并不表示 0 就是真值。区间内其他非零斜率同样合理。
- 检查估计值 $b$ 是否离 0 很远,而不是检查 0 是否落在区间内。$b$ 大不大取决于 $SE_b$。
- 弄错方向:只含负值的区间表示负关系,尽管数值带有负号。
A 95% confidence interval for a slope is $(-0.8,\ 3.1)$. What can you conclude about a linear relationship?斜率的 95% 置信区间为 $(-0.8,\ 3.1)$。关于线性关系可以得出什么结论?
The interval contains 0, so 0 is a plausible slope. There is not convincing evidence of a linear relationship (at the 5% significance level). We cannot conclude there is no relationship.
区间含 0,所以 0 是合理的斜率。(在 5% 显著性水平下)没有令人信服的证据表明存在线性关系。但不能断定没有关系。
A 99% interval for $\beta$ is $(0.12,\ 0.58)$. A researcher claims $\beta = 0.5$. Does the interval support the claim, and is there evidence of a linear relationship?$\beta$ 的 99% 区间为 $(0.12,\ 0.58)$。一位研究者声称 $\beta = 0.5$。区间是否支持该说法?是否有线性关系的证据?
0.5 lies inside the interval, so it is a plausible value and the data are consistent with the claim. The interval excludes 0, so there is convincing evidence of a positive linear relationship.
0.5 落在区间内,是合理取值,数据与该说法相符。区间不含 0,所以有令人信服的证据表明存在正的线性关系。
A two-sided test of $H_0\!: \beta = 0$ is run at $\alpha = 0.01$. Which confidence level gives the matching interval?在 $\alpha = 0.01$ 下进行 $H_0\!: \beta = 0$ 的双侧检验。哪个置信水平给出对应的区间?
$C = 1 - \alpha = 0.99$, a 99% interval. If it excludes 0, the test rejects $H_0$.
$C = 1 - \alpha = 0.99$,即 99% 区间。若它不含 0,检验就拒绝 $H_0$。
A 95% interval for the slope of sleep on screen time is $(-0.54,\ -0.30)$ hours per hour. Explain what it says about direction and size, in context.睡眠对屏幕时间的斜率的 95% 区间为 $(-0.54,\ -0.30)$ 小时/小时。请结合情境解释它在方向与大小上说明了什么。
Both endpoints are negative, so more screen time goes with less sleep. We are 95% confident that mean nightly sleep falls by between 0.30 and 0.54 hours (about 18 to 32 minutes) for each additional hour of daily screen time.
两个端点均为负,所以屏幕时间越多,睡眠越少。我们有 95% 的把握认为,每日屏幕时间每增加一小时,每晚平均睡眠减少 0.30 到 0.54 小时(约 18 到 32 分钟)。
Hypotheses and Conditions for a Slope Test斜率检验的假设与条件
- State the null and alternative hypotheses for a test of the slope, $H_0\!: \beta = 0$ against $H_a\!: \beta \neq 0$, $\beta > 0$ or $\beta < 0$, in context.
- Define the parameter $\beta$ in words, with the population and the units.
- Check linearity with a scatterplot and a residual plot.
- Check Normality with a Normal probability plot, dotplot or histogram of the residuals.
- Identify unequal variance (a fan) and curvature in a residual plot, and say what each does to the inference.
- 用情境写出斜率检验的原假设与备择假设:$H_0\!: \beta = 0$ 对 $H_a\!: \beta \neq 0$、$\beta > 0$ 或 $\beta < 0$。
- 用文字定义参数 $\beta$,写明总体与单位。
- 用散点图与残差图检查线性。
- 用残差的正态概率图、点图或直方图检查正态性。
- 在残差图中识别不等方差(扇形)与弯曲,并说明各自对推断的影响。
Hypotheses for a test of the slope斜率检验的假设
A significance test asks whether sample evidence is strong enough to show that a linear relationship exists in the population. The null hypothesis says there is none: the population slope is zero, $H_0\!: \beta = 0$. The alternative hypothesis says there is: $H_a\!: \beta \neq 0$ (a linear relationship of either direction), $H_a\!: \beta > 0$ (a positive linear relationship) or $H_a\!: \beta < 0$ (a negative one). Choose the alternative from the question asked before looking at the data. The hypotheses are always about the parameter $\beta$, never about $b$.
显著性检验问的是:样本证据是否强到足以表明总体中存在线性关系。原假设(null hypothesis)说不存在:总体斜率为零,$H_0\!: \beta = 0$。备择假设(alternative hypothesis)说存在:$H_a\!: \beta \neq 0$(任一方向的线性关系)、$H_a\!: \beta > 0$(正的线性关系)或 $H_a\!: \beta < 0$(负的线性关系)。备择假设应在看数据之前根据所问问题选定。假设永远针对参数 $\beta$,而不是 $b$。
| Screen time $x$ (h/day) | 1.0 | 1.5 | 2.0 | 2.5 | 3.0 | 3.0 | 3.5 | 4.0 | 4.5 | 5.0 | 5.5 | 6.0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Sleep $y$ (h/night) | 8.6 | 8.1 | 8.4 | 7.7 | 7.9 | 7.2 | 7.5 | 6.9 | 7.4 | 6.6 | 6.8 | 6.3 |
| 屏幕时间 $x$(小时/天) | 1.0 | 1.5 | 2.0 | 2.5 | 3.0 | 3.0 | 3.5 | 4.0 | 4.5 | 5.0 | 5.5 | 6.0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 睡眠 $y$(小时/晚) | 8.6 | 8.1 | 8.4 | 7.7 | 7.9 | 7.2 | 7.5 | 6.9 | 7.4 | 6.6 | 6.8 | 6.3 |
Worked Example: write hypotheses in context例题:结合情境写假设
A researcher takes a random sample of 12 students from a school and records daily screen time (hours) and nightly sleep (hours); the illustrative data are in the table above. She suspects that more screen time goes with less sleep. State the hypotheses.
- Parameter: let $\beta$ be the true slope of the population regression line relating nightly sleep (hours) to daily screen time (hours) for all students at the school.
- $H_0\!: \beta = 0$: there is no linear relationship between daily screen time and nightly sleep for students at this school.
- $H_a\!: \beta < 0$: there is a negative linear relationship between daily screen time and nightly sleep for students at this school. The one-sided alternative matches her suspicion, which was stated before the data were examined.
- If she had only asked whether the two variables are linearly related, the alternative would be two-sided, $H_a\!: \beta \neq 0$.
一位研究者从某校随机抽取 12 名学生,记录每日屏幕时间(小时)与每晚睡眠(小时);示例数据见上表。她怀疑屏幕时间越多睡眠越少。写出假设。
- 参数:设 $\beta$ 为该校全体学生中,每晚睡眠(小时)对每日屏幕时间(小时)的总体回归直线的真实斜率。
- $H_0\!: \beta = 0$:该校学生每日屏幕时间与每晚睡眠之间没有线性关系。
- $H_a\!: \beta < 0$:该校学生每日屏幕时间与每晚睡眠之间存在负的线性关系。单侧备择假设符合她在检查数据之前就提出的怀疑。
- 如果她只是问两个变量是否线性相关,备择假设应为双侧的 $H_a\!: \beta \neq 0$。
Checking the conditions with plots用图形检查条件
Three displays do the checking. A scatterplot of $y$ against $x$ shows whether the pattern is roughly linear and whether any point is far from the rest. A residual plot (residuals against $x$, or against the fitted values) is the sharper tool: it should look like a horizontal band of random scatter around 0, with about the same vertical spread everywhere. A Normal probability plot of the residuals should be close to a straight line; a dotplot or histogram of the residuals should be roughly symmetric with no strong skew or outliers. Independence comes from how the data were collected (random sample or random assignment, with the 10% condition), not from a plot.
三种图形完成检查。散点图(scatterplot)显示 $y$ 对 $x$ 的模式是否大致线性,以及是否有点远离其他点。残差图(residual plot,残差对 $x$ 或对拟合值)更为敏锐:它应像一条围绕 0 的水平随机散布带,各处纵向散布大致相同。残差的正态概率图(normal probability plot)应接近一条直线;残差的点图或直方图应大致对称,无明显偏斜或离群点。独立性来自数据收集方式(随机抽样或随机分配,并满足 10% 条件),而不是来自某张图。
- Curved residual pattern: the true relationship is not linear, so a straight-line model and its slope $t$ procedures are not appropriate. Consider a different model or a transformation.
- Fan shape: the variability of $y$ changes with $x$, so $s$ and $SE_b$ do not describe every part of the data. Probabilities from the $t$ procedures are unreliable.
- Strong skew or outliers in the residuals: the Normal condition fails. With a small sample this matters; with a large sample the $t$ procedures are more forgiving of mild non-Normality, but outliers still need investigation.
- 残差呈弯曲模式:真实关系不是线性的,直线模型及其斜率 $t$ 程序不适用。可考虑其他模型或变换。
- 扇形:$y$ 的变异性随 $x$ 而变,所以 $s$ 与 $SE_b$ 不能描述数据的各个部分。$t$ 程序给出的概率不可靠。
- 残差强烈偏斜或有离群点:正态条件不成立。样本小时这很重要;样本大时 $t$ 程序对轻微的非正态较宽容,但离群点仍需调查。
Worked Example: read three residual plots例题:判读三张残差图
Each plot in Figure 9.4 comes from a different data set. For each, say whether the LINE conditions are supported and what to do.
- Left (random scatter): the points form a patternless band about 0 with a steady vertical spread. Linear and Equal variance are supported; go on to check Normality and Independence.
- Middle (curve): the residuals fall, then rise, in a U shape (positive at both ends, negative in the middle). The Linear condition fails, so do not do inference with the straight-line model.
- Right (fan): the spread of the residuals is narrow for small $x$ and wide for large $x$. The Equal variance condition fails, so the standard error does not apply equally everywhere.
Why this works: if the line captured the whole relationship, what is left over (the residuals) would be pure random noise with no pattern.
图 9.4 中每张图来自不同的数据集。对每张图,说明 LINE 条件是否得到支持,以及应怎么做。
- 左(随机散布):各点围绕 0 形成无规律的带,纵向散布稳定。线性与等方差得到支持;接着检查正态性与独立性。
- 中(弯曲):残差先降后升,呈 U 形(两端为正,中间为负)。线性条件不成立,因此不要用直线模型做推断。
- 右(扇形):$x$ 小时残差散布窄,$x$ 大时散布宽。等方差条件不成立,标准误并非处处适用。
为何成立:若直线抓住了全部关系,剩下的部分(残差)就应是没有任何模式的纯随机噪声。
Worked Example: a complete condition check例题:完整的条件检查
Check the LINE conditions for the study-hours data of Topic 12.1: a random sample of 15 students from a school of 1,200. The fitted-line residuals, in increasing order, are $-5.83,\allowbreak\ -5.13,\allowbreak\ -4.74,\allowbreak\ -3.98,\allowbreak\ -3.60,\allowbreak\ -2.07,\allowbreak\ -1.89,\allowbreak\ -0.21,\allowbreak\ 0.64,\allowbreak\ 2.17,\allowbreak\ 2.32,\allowbreak\ 3.55,\allowbreak\ 5.26,\allowbreak\ 6.49,\allowbreak\ 7.02$.
- Linear: the scatterplot (Figure 9.1) rises in a roughly straight band, and the residual plot has no curved pattern.
- Independent: the students were selected at random, and $15 < 0.10 \times 1200 = 120$, so the 10% condition is met.
- Normal: a dotplot of the 15 residuals is roughly symmetric about 0 (the middle residual is $-0.21$, and the extremes $-5.83$ and $7.02$ are about the same distance out) with no outliers. A Normal probability plot of them lies close to a straight line.
- Equal variance: the residual plot shows about the same vertical spread (roughly $\pm 6$) at small, medium and large hours, with no fan.
- Conclusion: all four conditions are reasonable, so $t$ procedures for the slope can be used.
检查 9.1 节学习时间数据的 LINE 条件:从一所 1,200 人的学校随机抽取 15 名学生。拟合直线的残差由小到大为 $-5.83,\allowbreak\ -5.13,\allowbreak\ -4.74,\allowbreak\ -3.98,\allowbreak\ -3.60,\allowbreak\ -2.07,\allowbreak\ -1.89,\allowbreak\ -0.21,\allowbreak\ 0.64,\allowbreak\ 2.17,\allowbreak\ 2.32,\allowbreak\ 3.55,\allowbreak\ 5.26,\allowbreak\ 6.49,\allowbreak\ 7.02$。
- 线性:散点图(图 9.1)呈大致笔直的上升带,残差图没有弯曲模式。
- 独立:学生为随机抽取,且 $15 < 0.10 \times 1200 = 120$,满足 10% 条件。
- 正态:15 个残差的点图大致关于 0 对称(中位数残差为 $-0.21$,两端的 $-5.83$ 与 $7.02$ 离中心距离相近),无离群点。其正态概率图接近一条直线。
- 等方差:残差图在小、中、大小时数处的纵向散布大致相同(约 $\pm 6$),不呈扇形。
- 结论:四个条件都合理,可以使用斜率的 $t$ 程序。
Worked Example: read a Normal probability plot of residuals例题:判读残差的正态概率图
A Normal probability plot graphs each residual against the value it would have if the residuals were exactly Normal. How do you judge it?
- Points close to a straight line: the residuals are consistent with a Normal distribution, so the Normal condition is met.
- A bend or S shape: a symmetric but heavy-tailed or light-tailed distribution.
- A curve that bows one way: a skewed distribution of residuals. A single point far from the line signals a possible outlier.
- With few points (such as 10 or 15) the plot is noisy, so only a clear, systematic departure from a line is evidence against Normality.
正态概率图把每个残差与残差若恰好服从正态时应有的值作图。怎样判断?
- 点接近一条直线:残差与正态分布相符,正态条件成立。
- 弯折或 S 形:分布对称但尾部偏重或偏轻。
- 向一侧弯曲的曲线:残差分布偏斜。远离直线的单个点提示可能的离群点。
- 点很少时(如 10 或 15 个)图形噪声大,只有清楚而系统的偏离直线才是反对正态的证据。
When a question says "check the conditions", do not just list LINE. Name the display, say what it shows, and tie it to the condition: "The residual plot shows random scatter with no pattern and a steady spread, so the Linear and Equal variance conditions are met." For Independence, quote the random sample or random assignment and verify $n < 10\%$ of the population. If the problem gives only computer output and no plots, say that the conditions cannot be verified from the output and state what you would check.
题目要求“检查条件”时,不要只列出 LINE。要点明所用图形,说出它显示什么,并联系到相应条件:“残差图显示随机散布,无模式,散布稳定,所以线性与等方差条件成立。”对独立性,要引用随机抽样或随机分配,并验证 $n < 10\%$(小于总体的 10%)。如果题目只给计算机输出而没有图形,要说明仅凭输出无法验证条件,并写出你会检查什么。
- Writing the hypotheses with $b$ or $r$ (for example $H_0\!: b = 0$). The null hypothesis is about the parameter $\beta$.
- Checking Normality from a histogram of $y$ or of $x$. Use the residuals.
- Declaring Linear satisfied because $r$ is large. A strong correlation does not rule out curvature; look at the residual plot.
- 用 $b$ 或 $r$ 写假设(如 $H_0\!: b = 0$)。原假设针对的是参数 $\beta$。
- 用 $y$ 或 $x$ 的直方图检查正态性。应使用残差。
- 因为 $r$ 很大就认为线性成立。强相关并不排除弯曲;要看残差图。
A teacher wants to know whether there is any linear relationship (positive or negative) between hours of sleep and quiz score for her students. State $H_0$ and $H_a$.一位老师想知道其学生的睡眠时间与测验分数之间是否存在任何线性关系(正或负)。写出 $H_0$ 与 $H_a$。
$H_0\!: \beta = 0$ (no linear relationship between sleep and quiz score for these students). $H_a\!: \beta \neq 0$ (there is a linear relationship). The alternative is two-sided because the direction was not specified.
$H_0\!: \beta = 0$(这些学生的睡眠与测验分数之间没有线性关系)。$H_a\!: \beta \neq 0$(存在线性关系)。因未指定方向,备择假设是双侧的。
A residual plot is a fan: points tightly clustered at the left and widely scattered at the right. Which condition fails, and why does that matter?残差图呈扇形:左边点紧密聚集,右边点散布很宽。哪个条件不成立?这为何重要?
The Equal variance condition fails. The standard deviation of $y$ about the line is not the same for every $x$, so one value of $s$ (and of $SE_b$) cannot describe the data everywhere, and the $t$ procedure's probabilities are unreliable.
等方差条件不成立。$y$ 围绕直线的标准差并非对每个 $x$ 都相同,一个 $s$(以及 $SE_b$)不能处处描述数据,$t$ 程序的概率不可靠。
Which display would you use to check (i) Linear, (ii) Normal, (iii) Independent?检查 (i) 线性、(ii) 正态、(iii) 独立,各应使用哪种图形或依据?
(i) A scatterplot and a residual plot. (ii) A Normal probability plot, dotplot or histogram of the residuals. (iii) No plot: it depends on how the data were collected (random sample or random assignment) plus the 10% condition.
(i) 散点图与残差图。(ii) 残差的正态概率图、点图或直方图。(iii) 不用图:取决于数据的收集方式(随机抽样或随机分配)以及 10% 条件。
A researcher claims $H_0\!: b = 0$. What is wrong?一位研究者写 $H_0\!: b = 0$。错在哪里?
$b$ is the sample slope, which is known from the data and is almost never exactly 0. The null hypothesis must be about the unknown population slope, $H_0\!: \beta = 0$.
$b$ 是样本斜率,由数据得知,几乎不可能恰好为 0。原假设必须针对未知的总体斜率,即 $H_0\!: \beta = 0$。
Tests for the Slope斜率的检验
- Write the test statistic for a slope, $t = \dfrac{b}{SE_b}$, and state its degrees of freedom $n-2$.
- Find a $p$-value from computer output or with the TI-84 LinRegTTest, and convert a two-sided $p$-value to a one-sided one.
- Carry out a complete $t$-test for the slope: hypotheses, conditions, test statistic, $p$-value and conclusion.
- Write a conclusion in context that uses "convincing evidence" and refers to the population.
- Explain why a significant slope shows a linear relationship but shows causation only for a randomized experiment.
- 写出斜率的检验统计量 $t = \dfrac{b}{SE_b}$,并说明其自由度为 $n-2$。
- 由计算机输出或 TI-84 的 LinRegTTest 得到 $p$ 值,并把双侧 $p$ 值换算为单侧。
- 完成斜率 $t$ 检验的全过程:假设、条件、检验统计量、$p$ 值与结论。
- 写出结合情境的结论,使用“令人信服的证据”并指明总体。
- 解释为什么显著的斜率只说明存在线性关系,只有随机化实验才说明因果关系。
The test of $H_0\!: \beta = 0$ standardizes the sample slope: how many standard errors is $b$ from the null value 0? When the LINE conditions hold and $H_0$ is true, this statistic follows a $t$ distribution with $n-2$ degrees of freedom. The $p$-value is the probability, assuming $H_0$ is true, of a value of $t$ at least as extreme as the one observed, in the direction of $H_a$.
检验 $H_0\!: \beta = 0$ 要把样本斜率标准化:$b$ 离原假设值 0 有多少个标准误?当 LINE 条件成立且 $H_0$ 为真时,这个统计量服从自由度为 $n-2$ 的 $t$ 分布。$p$ 值(p-value)是在 $H_0$ 为真的假定下,得到至少与观测值一样极端(沿 $H_a$ 的方向)的 $t$ 值的概率。
$$t = \dfrac{b}{SE_b}, \qquad df = n-2$$
Two-sided $H_a\!: \beta \neq 0$: the $p$-value is the area in both tails beyond $\pm t$. One-sided $H_a\!: \beta > 0$ or $\beta < 0$: the area in one tail only. Reject $H_0$ when the $p$-value is less than the significance level $\alpha$.
$$t = \dfrac{b}{SE_b}, \qquad df = n-2$$
双侧 $H_a\!: \beta \neq 0$:$p$ 值是 $\pm t$ 之外两个尾部的面积。单侧 $H_a\!: \beta > 0$ 或 $\beta < 0$:只取一个尾部的面积。当 $p$ 值小于显著性水平 $\alpha$ 时拒绝 $H_0$。
In computer output the P in the slope row is the two-sided $p$-value. If the alternative is one-sided and the sign of $b$ agrees with it, divide that $P$ by 2. If the sign of $b$ disagrees with the alternative, the one-sided $p$-value is more than 0.5 and $H_0$ is not rejected. The calculator command LinRegTTest (STAT, right arrow to TESTS) takes Xlist, Ylist, Freq and the alternative (β & ρ: $\neq 0$, $< 0$ or $> 0$) and returns $t$, the $p$-value for the alternative you chose, $df$, $a$, $b$, $s$, $r^2$ and $r$.
计算机输出中斜率行的 P 是双侧 $p$ 值。若备择假设是单侧且 $b$ 的符号与其一致,把这个 $P$ 除以 2。若 $b$ 的符号与备择假设相反,单侧 $p$ 值大于 0.5,不拒绝 $H_0$。计算器命令 LinRegTTest(STAT,右方向键移到 TESTS)需要 Xlist、Ylist、Freq 与备择假设(β & ρ:$\neq 0$、$< 0$ 或 $> 0$),返回 $t$、所选备择假设对应的 $p$ 值、$df$、$a$、$b$、$s$、$r^2$ 与 $r$。
Worked Example: a complete two-sided test from computer output例题:由计算机输出完成的双侧检验
Use the output of Topic 12.2 for the 15 randomly sampled students (study hours and test score). Is there convincing evidence of a linear relationship between weekly study hours and test score for students at this school? Use $\alpha = 0.05$.
- Hypotheses: let $\beta$ be the true slope of the population regression line relating test score to weekly study hours for all students at the school. $H_0\!: \beta = 0$, $H_a\!: \beta \neq 0$.
- Procedure and conditions: a $t$-test for the slope. The conditions were checked in Topic 12.4: linear scatterplot and patternless residual plot, random sample with $15 < 10\%$ of 1,200, roughly Normal residuals and steady spread.
- Test statistic: $t = \dfrac{b}{SE_b} = \dfrac{2.6173}{0.3595} = 7.28$, with $df = 15 - 2 = 13$.
- $p$-value: $2\,P(t_{13} \geq 7.28) = 0.000006$, which is less than 0.001 and matches
P = 0.000in the output. - Conclusion in context: the $p$-value is less than $\alpha = 0.05$, so we reject $H_0$. There is convincing evidence of a linear relationship between weekly study hours and test score for students at this school.
- Scope: the random sample lets us generalize to the school's students, but students chose their own study time, so this is observational and we cannot conclude that studying longer causes higher scores.
使用 9.2 节中 15 名随机抽取学生(学习小时数与测验分数)的输出。有无令人信服的证据表明该校学生每周学习小时数与测验分数之间存在线性关系?取 $\alpha = 0.05$。
- 假设:设 $\beta$ 为该校全体学生中,测验分数对每周学习小时数的总体回归直线的真实斜率。$H_0\!: \beta = 0$,$H_a\!: \beta \neq 0$。
- 程序与条件:斜率的 $t$ 检验。条件已在 9.4 节检查:散点图呈线性且残差图无模式;随机样本且 $15 < 10\%$ 的 1,200;残差大致正态;散布稳定。
- 检验统计量:$t = \dfrac{b}{SE_b} = \dfrac{2.6173}{0.3595} = 7.28$,$df = 15 - 2 = 13$。
- $p$ 值:$2\,P(t_{13} \geq 7.28) = 0.000006$,小于 0.001,与输出中的
P = 0.000一致。 - 结合情境的结论:$p$ 值小于 $\alpha = 0.05$,所以拒绝 $H_0$。有令人信服的证据表明该校学生每周学习小时数与测验分数之间存在线性关系。
- 适用范围:随机样本使结论可推广到该校学生,但学生是自己选择学习时间的,属于观察研究,不能断定多学习导致更高分数。
Worked Example: a one-sided test with LinRegTTest例题:用 LinRegTTest 做单侧检验
For the 12 randomly sampled students whose daily screen time and nightly sleep are tabulated in Topic 12.4, test whether more screen time goes with less sleep. Use $\alpha = 0.05$.
- Hypotheses: $\beta$ is the true slope of the population regression line relating nightly sleep (hours) to daily screen time (hours) for students at the school. $H_0\!: \beta = 0$ and $H_a\!: \beta < 0$.
- TI-84: enter the screen times in
L1and the sleep times inL2. ChooseSTAT, press the right arrow to reachTESTS, thenLinRegTTestwithXlist: L1,Ylist: L2,Freq: 1,β & ρ: < 0, thenCalculate. - Screen shows: $t = -7.911$, $p = 6.49E-6$, $df = 10$, $a = 8.912$, $b = -0.4228$, $s = 0.2815$, $r^2 = 0.8622$, $r = -0.9286$.
- Check by hand: $SE_b = 0.0535$, so $t = \dfrac{b}{SE_b} = \dfrac{-0.4228}{0.0535} = -7.91$ with $df = 12 - 2 = 10$. The two-sided value is $1.30E-5$; halving it gives the one-sided $p$-value, because the sign of $b$ matches $H_a$.
- Conclusion in context: the $p$-value is far below 0.05, so we reject $H_0$. There is convincing evidence of a negative linear relationship between daily screen time and nightly sleep for students at this school. Screen time was not assigned, so this is an association only.
对 9.4 节表中随机抽取的 12 名学生的每日屏幕时间与每晚睡眠,检验屏幕时间越多是否睡眠越少。取 $\alpha = 0.05$。
- 假设:$\beta$ 是该校学生每晚睡眠(小时)对每日屏幕时间(小时)的总体回归直线的真实斜率。$H_0\!: \beta = 0$,$H_a\!: \beta < 0$。
- TI-84:把屏幕时间输入
L1,睡眠时间输入L2。按STAT,按右方向键移到TESTS,选LinRegTTest,设Xlist: L1、Ylist: L2、Freq: 1、β & ρ: < 0,然后Calculate。 - 屏幕显示:$t = -7.911$,$p = 6.49E-6$,$df = 10$,$a = 8.912$,$b = -0.4228$,$s = 0.2815$,$r^2 = 0.8622$,$r = -0.9286$。
- 手算核对:$SE_b = 0.0535$,所以 $t = \dfrac{b}{SE_b} = \dfrac{-0.4228}{0.0535} = -7.91$,$df = 12 - 2 = 10$。双侧值为 $1.30E-5$;因 $b$ 的符号与 $H_a$ 一致,减半即得单侧 $p$ 值。
- 结合情境的结论:$p$ 值远小于 0.05,所以拒绝 $H_0$。有令人信服的证据表明该校学生每日屏幕时间与每晚睡眠之间存在负的线性关系。屏幕时间不是分配的,所以只是关联。
Worked Example: a test that does not reject例题:不拒绝原假设的检验
For the 10 randomly sampled students of Topic 12.3 (hours of background music and vocabulary quiz score out of 20), $b = 0.2727$ and $SE_b = 0.3402$. Test for a linear relationship at $\alpha = 0.05$.
- $H_0\!: \beta = 0$, $H_a\!: \beta \neq 0$, where $\beta$ is the true slope relating vocabulary quiz score to weekly hours of background music for students at the school.
- $t = \dfrac{b}{SE_b} = \dfrac{0.2727}{0.3402} = 0.80$, $df = 10 - 2 = 8$.
- $p$-value $= 2\,P(t_{8} \geq 0.80) = 0.446$ (Figure 9.5).
- Because $p = 0.446 > 0.05$, we fail to reject $H_0$. We do not have convincing evidence of a linear relationship between weekly hours of background music and vocabulary quiz score for students at this school.
- This agrees with Topic 12.3: the 95% interval $(-0.512,\ 1.057)$ contains 0. We have not shown that the slope is 0, only that these 10 students do not give strong enough evidence to say it is not.
对 9.3 节随机抽取的 10 名学生(背景音乐小时数与满分 20 分的词汇测验分数),$b = 0.2727$,$SE_b = 0.3402$。在 $\alpha = 0.05$ 下检验是否存在线性关系。
- $H_0\!: \beta = 0$,$H_a\!: \beta \neq 0$,其中 $\beta$ 是该校学生词汇测验分数对每周背景音乐小时数的真实斜率。
- $t = \dfrac{b}{SE_b} = \dfrac{0.2727}{0.3402} = 0.80$,$df = 10 - 2 = 8$。
- $p$ 值 $= 2\,P(t_{8} \geq 0.80) = 0.446$(图 9.5)。
- 因为 $p = 0.446 > 0.05$,不拒绝 $H_0$。没有令人信服的证据表明该校学生每周背景音乐小时数与词汇测验分数之间存在线性关系。
- 这与 9.3 节一致:95% 区间 $(-0.512,\ 1.057)$ 含 0。我们并没有证明斜率为 0,只是这 10 名学生提供的证据不足以说它不为 0。
Association and causation关联与因果
A small $p$-value says the linear relationship in the data is too strong to be explained by chance alone. It does not say why the variables are related. Cause and effect can be concluded only when the explanatory variable was assigned to the units by random assignment in an experiment; in an observational study a lurking variable may explain the relationship. And a conclusion extends to a larger population only if the units were a random sample from it.
小的 $p$ 值说明数据中的线性关系强到不能仅用偶然解释,但并不说明变量为什么相关。只有在实验中通过随机分配把解释变量指派给个体时,才能得出因果结论;在观察研究中,潜在变量也可能解释这种关系。而结论能否推广到更大总体,则取决于个体是否是该总体的随机样本。
| Fertilizer $x$ (g/m²) | 10 | 10 | 20 | 20 | 30 | 30 | 40 | 40 | 50 | 50 | 60 | 60 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Yield $y$ (kg) | 31 | 34 | 38 | 35 | 42 | 45 | 44 | 49 | 53 | 50 | 55 | 58 |
| 施肥量 $x$(克/平方米) | 10 | 10 | 20 | 20 | 30 | 30 | 40 | 40 | 50 | 50 | 60 | 60 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 产量 $y$(千克) | 31 | 34 | 38 | 35 | 42 | 45 | 44 | 49 | 53 | 50 | 55 | 58 |
Worked Example: a randomized experiment supports a causal conclusion例题:随机化实验支持因果结论
A gardener randomly assigns 6 fertilizer levels (10 to 60 g/m², two plots each) to 12 plots of the same tomato variety; the illustrative data are above. Test whether the amount of fertilizer is linearly related to mean yield. The output gives $b = 0.480$ kg per g/m² and $SE_b = 0.03406$.
- $H_0\!: \beta = 0$, $H_a\!: \beta \neq 0$, where $\beta$ is the true slope relating mean tomato yield (kg per plot) to fertilizer amount (g/m²).
- Conditions: the scatterplot is linear and the residual plot (residuals between $-2.9$ and $2.9$) shows no pattern or fan; the residuals are roughly Normal; the fertilizer levels were randomly assigned, which gives independence.
- $t = \dfrac{0.480}{0.03406} = 14.09$ with $df = 10$; the $p$-value is less than 0.001.
- Conclusion: we reject $H_0$. There is convincing evidence of a linear relationship between fertilizer amount and mean tomato yield.
- Causation: because the amounts were randomly assigned to plots, differences in yield can be attributed to the fertilizer, so we can conclude that increasing fertilizer causes an increase in mean yield, for plots like these. The plots were not randomly selected from all gardens, so we cannot extend the conclusion beyond them.
一位园丁把 6 个施肥水平(10 到 60 克/平方米,每水平两块地)随机分配给 12 块种植同一番茄品种的地;示例数据见上表。检验施肥量与平均产量是否存在线性关系。输出给出 $b = 0.480$ 千克/(克/平方米),$SE_b = 0.03406$。
- $H_0\!: \beta = 0$,$H_a\!: \beta \neq 0$,其中 $\beta$ 是平均番茄产量(千克/块)对施肥量(克/平方米)的真实斜率。
- 条件:散点图呈线性,残差图(残差在 $-2.9$ 与 $2.9$ 之间)无模式且不呈扇形;残差大致正态;施肥水平为随机分配,保证独立。
- $t = \dfrac{0.480}{0.03406} = 14.09$,$df = 10$;$p$ 值小于 0.001。
- 结论:拒绝 $H_0$。有令人信服的证据表明施肥量与平均番茄产量之间存在线性关系。
- 因果:因为施肥量是随机分配给各地块的,产量差异可归因于肥料,所以可以断定,对与这些地块相似的地块,增加施肥量会导致平均产量增加。这些地块不是从所有园地中随机选出的,所以结论不能推广到它们之外。
"Because the $p$-value of [value] is [less than / greater than] $\alpha = [\,]$, we [reject / fail to reject] $H_0$. We [do / do not] have convincing evidence of a [positive / negative] linear relationship between [$x$ in context] and [$y$ in context] for [population]." Add a causation sentence only if the study was a randomized experiment.
“因为 $p$ 值 [数值] [小于 / 大于] $\alpha = [\,]$,所以我们 [拒绝 / 不拒绝] $H_0$。我们 [有 / 没有] 令人信服的证据表明 [总体] 中 [情境中的 $x$] 与 [情境中的 $y$] 之间存在 [正的 / 负的] 线性关系。”只有研究是随机化实验时,才补充因果的句子。
Write the conclusion in the language of the question: "convincing evidence" (never "prove"), the variables named in context, the population, and a link to the $p$-value and $\alpha$. Calculator output alone does not explain your reasoning, so state the procedure (a $t$-test for the slope), the $t$ value, $df$ and $p$-value yourself. Do not claim causation unless the question describes random assignment.
用题目的语言写结论:“令人信服的证据”(绝不用“证明”)、结合情境命名的变量、总体,以及与 $p$ 值和 $\alpha$ 的联系。只抄计算器输出并不能说明你的推理,所以要自己写出程序(斜率的 $t$ 检验)、$t$ 值、$df$ 与 $p$ 值。除非题目描述了随机分配,否则不要声称因果。
- Saying the $p$-value is the probability that $H_0$ is true. It is the probability of a result this extreme if $H_0$ is true.
- Using the two-sided
Pfrom the output for a one-sided alternative without halving it (or halving it when the sign of $b$ contradicts $H_a$). - Concluding "$x$ causes $y$" from a small $p$-value in an observational study, or "there is no relationship" from a large $p$-value.
- 说 $p$ 值是 $H_0$ 为真的概率。它是在 $H_0$ 为真时出现如此极端结果的概率。
- 对单侧备择假设直接使用输出中的双侧
P而不减半(或在 $b$ 的符号与 $H_a$ 相反时仍然减半)。 - 在观察研究中由小的 $p$ 值得出“$x$ 导致 $y$”,或由大的 $p$ 值得出“没有关系”。
Regression output gives Coef $= 3.2$ and SE Coef $= 0.8$ for the slope, with $n = 18$. Calculate the test statistic and degrees of freedom for $H_0\!: \beta = 0$.回归输出给出斜率的 Coef $= 3.2$,SE Coef $= 0.8$,$n = 18$。计算检验 $H_0\!: \beta = 0$ 的检验统计量与自由度。
$t = \dfrac{3.2}{0.8} = 4.0$ with $df = 18 - 2 = 16$.
$t = \dfrac{3.2}{0.8} = 4.0$,$df = 18 - 2 = 16$。
The output reports $P = 0.08$ for a slope with $b > 0$. A researcher tests $H_a\!: \beta > 0$ at $\alpha = 0.05$. What is the $p$-value and the decision?输出中斜率的 $P = 0.08$,且 $b > 0$。研究者在 $\alpha = 0.05$ 下检验 $H_a\!: \beta > 0$。$p$ 值是多少?结论如何?
The output is two-sided and $b$ agrees with $H_a$, so the one-sided $p$-value is $0.08 / 2 = 0.04$. Since $0.04 < 0.05$, reject $H_0$: convincing evidence of a positive linear relationship.
输出为双侧值且 $b$ 与 $H_a$ 一致,故单侧 $p$ 值为 $0.08 / 2 = 0.04$。因为 $0.04 < 0.05$,拒绝 $H_0$:有令人信服的证据表明存在正的线性关系。
A random sample of schools shows a significant positive slope between the number of library books per student and mean reading score. A newspaper writes "buying more books will raise reading scores." Evaluate it.对学校的一个随机样本,生均图书册数与平均阅读成绩之间有显著的正斜率。一家报纸写道“买更多书会提高阅读成绩”。请评价。
The data are observational, so only an association is shown. Wealthier schools could have both more books and higher scores (a lurking variable). Causation would need random assignment of book budgets to schools.
数据是观察性的,只显示关联。较富裕的学校可能既有更多图书又有更高成绩(潜在变量)。要得出因果,需要把图书预算随机分配给学校。
A test of $H_0\!: \beta = 0$ gives $p = 0.31$. Write the conclusion in context for a study of rainfall (mm) and crop yield (kg per plot) for farms in a region, using $\alpha = 0.05$.检验 $H_0\!: \beta = 0$ 得 $p = 0.31$。就某地区农场的降雨量(毫米)与作物产量(千克/块)的研究,取 $\alpha = 0.05$,写出结合情境的结论。
Because $0.31 > 0.05$ we fail to reject $H_0$. We do not have convincing evidence of a linear relationship between rainfall and crop yield for farms in this region. We have not shown that no relationship exists.
因为 $0.31 > 0.05$,不拒绝 $H_0$。没有令人信服的证据表明该地区农场的降雨量与作物产量之间存在线性关系。但我们并没有证明不存在关系。
Selecting an Appropriate Inference Procedure选择合适的推断程序
- Decide which inference procedure fits a scenario from the type of variables, the number of samples and the parameter of interest.
- Distinguish the $t$-test for a slope from a paired $t$-test, a two-sample $t$-test and a chi-square test.
- State the parameter and hypotheses that match the chosen procedure.
- Justify the choice of procedure in one sentence that refers to the data in the problem.
- Carry the chosen procedure through the four steps: state, plan, do, conclude.
- 根据变量类型、样本个数与所关心的参数,为情境选择合适的推断程序。
- 区分斜率的 $t$ 检验与配对 $t$ 检验、两样本 $t$ 检验以及卡方检验。
- 写出与所选程序对应的参数与假设。
- 用一句话并联系题目中的数据来论证所选程序。
- 按四步完成所选程序:陈述、计划、执行、结论。
Knowing how to run a procedure is half the job; the other half is deciding which procedure to run. Ask three questions in order. (1) What type of variable or variables: categorical or quantitative? (2) How many samples or groups, and are the measurements paired or on the same individuals? (3) What parameter does the question ask about: a proportion, a mean, a difference, an association or a slope?
会做一个程序只是一半,另一半是决定用哪个程序(select the appropriate procedure)。按顺序问三个问题。(1) 变量是什么类型:分类还是定量?(2) 有几个样本或组,测量是否配对或来自同一批个体?(3) 题目问的是哪种参数:比例、均值、差、关联还是斜率?
| Data and question | Procedure |
|---|---|
| One categorical variable, one sample; a proportion $p$ | One-sample $z$ interval or test for a proportion |
| One categorical variable, two groups; $p_1 - p_2$ | Two-sample $z$ interval or test for a difference of proportions |
| One quantitative variable, one sample; a mean $\mu$ | One-sample $t$ interval or test for a mean |
| One quantitative variable, two independent groups; $\mu_1 - \mu_2$ | Two-sample $t$ interval or test |
| One quantitative variable measured twice on the same individuals, or matched pairs; mean difference $\mu_d$ | Paired $t$ procedure (one-sample $t$ on the differences) |
| One categorical variable, one sample, compared with a claimed distribution | Chi-square goodness-of-fit test |
| One categorical variable in several populations or treatment groups | Chi-square test for homogeneity |
| Two categorical variables in one sample; association | Chi-square test for independence |
| Two quantitative variables on the same individuals; slope $\beta$ of the population regression line | $t$ interval or $t$ test for the slope |
| 数据与问题 | 程序 |
|---|---|
| 一个分类变量、一个样本;比例 $p$ | 比例的单样本 $z$ 区间或检验 |
| 一个分类变量、两组;$p_1 - p_2$ | 比例之差的两样本 $z$ 区间或检验 |
| 一个定量变量、一个样本;均值 $\mu$ | 均值的单样本 $t$ 区间或检验 |
| 一个定量变量、两个独立组;$\mu_1 - \mu_2$ | 两样本 $t$ 区间或检验 |
| 同一批个体上测量两次的定量变量,或配对数据;均值差 $\mu_d$ | 配对 $t$ 程序(对差值做单样本 $t$) |
| 一个分类变量、一个样本,与声称的分布比较 | 卡方拟合优度检验 |
| 一个分类变量在多个总体或处理组中 | 卡方齐性检验 |
| 一个样本中的两个分类变量;关联 | 卡方独立性检验 |
| 同一批个体上的两个定量变量;总体回归直线的斜率 $\beta$ | 斜率的 $t$ 区间或 $t$ 检验 |
Two traps deserve a warning. First, a paired design and a slope both involve two measurements on each individual, but they answer different questions: the paired $t$ procedure asks how much the measurements differ on average, while the slope procedure asks how one measurement changes with the other. Second, a chi-square test needs counts of categories, never two quantitative variables.
有两个陷阱需要提醒。第一,配对设计与斜率都涉及每个个体的两次测量,但回答的问题不同:配对 $t$ 程序问两次测量平均相差多少,斜率程序问一个测量如何随另一个测量变化。第二,卡方检验需要类别的计数,不能用于两个定量变量。
Worked Example: classify six scenarios例题:对六个情境分类
Choose the procedure for each scenario and give the reason.
- (a) A random sample of 120 voters is asked whether they favour a measure; is the true proportion different from 50%? One categorical variable, one sample: one-sample $z$-test for a proportion.
- (b) Battery life (hours) is measured for 25 randomly chosen batteries of brand X and 25 of brand Y. One quantitative variable, two independent groups: two-sample $t$-test for $\mu_X - \mu_Y$.
- (c) Blood pressure is measured for 30 patients before and after a treatment. The same individuals measured twice: paired $t$-test on the 30 differences.
- (d) 200 adults are classified by smoking status (3 categories) and exercise level (3 categories); is there an association? Two categorical variables in one sample: chi-square test for independence.
- (e) In a random sample of 40 students, height and arm span are measured; estimate the change in mean height per additional centimetre of arm span. Two quantitative variables on the same individuals and a rate of change: $t$-interval for the slope.
- (f) A die is rolled 600 times and the six face counts are compared with equal chances. One categorical variable against a claimed distribution: chi-square goodness-of-fit test.
为每个情境选择程序并给出理由。
- (a) 随机抽取 120 名选民询问是否赞成某措施;真实比例是否不等于 50%?一个分类变量、一个样本:比例的单样本 $z$ 检验。
- (b) 测量随机抽取的 25 个 X 牌电池和 25 个 Y 牌电池的寿命(小时)。一个定量变量、两个独立组:针对 $\mu_X - \mu_Y$ 的两样本 $t$ 检验。
- (c) 测量 30 名患者治疗前后的血压。同一批个体测量两次:对 30 个差值做配对 $t$ 检验。
- (d) 200 名成年人按吸烟状况(3 类)与运动水平(3 类)分类;是否存在关联?一个样本中的两个分类变量:卡方独立性检验。
- (e) 在 40 名学生的随机样本中测量身高与臂展;估计臂展每多一厘米时平均身高的变化。同一批个体上的两个定量变量,且问变化率:斜率的 $t$ 区间。
- (f) 把骰子掷 600 次,将六个面的次数与各面机会均等比较。一个分类变量对声称的分布:卡方拟合优度检验。
Worked Example: the same data, two different questions例题:同一组数据,两个不同的问题
Twelve randomly selected students take a pretest and, after a workshop, a posttest. Which procedure answers each question?
- Question 1: "Did scores improve, on average?" The parameter is the mean difference $\mu_d$ (posttest minus pretest) for all students who could take the workshop. Use a paired $t$ procedure.
- Question 2: "Can the pretest score be used to predict the posttest score?" The parameter is the slope $\beta$ of the population regression line of posttest on pretest. Use a $t$ procedure for the slope with $H_0\!: \beta = 0$ and $df = 12 - 2 = 10$.
- The data layout (two numbers per student) is identical, so the layout does not choose the procedure. The question and the parameter do.
随机选出的 12 名学生先做前测,参加研讨班后再做后测。下列问题各用哪个程序?
- 问题 1:“成绩平均是否提高?”参数是所有可参加研讨班的学生的均值差 $\mu_d$(后测减前测)。使用配对 $t$ 程序。
- 问题 2:“前测成绩能否用来预测后测成绩?”参数是后测对前测的总体回归直线斜率 $\beta$。使用斜率的 $t$ 程序,$H_0\!: \beta = 0$,$df = 12 - 2 = 10$。
- 两个问题的数据布局(每名学生两个数)完全相同,所以不是布局决定程序,而是问题和参数决定。
Worked Example: choose, then carry out, the procedure例题:先选择程序,再完整执行
A random sample of 25 used cars of one model is taken from the many more than 250 advertised for sale in a region, and records mileage $x$ (thousands of miles) and asking price $y$ (thousands of dollars). The regression output gives $b = -0.0850$ (thousand dollars per thousand miles) and $SE_b = 0.0215$; plots show no problems with the conditions. Is price linearly related to mileage? Use $\alpha = 0.05$.
- Which procedure? Both variables are quantitative, measured on the same cars in one sample, and the question is about a linear relationship, so choose a $t$-test for the slope. (Not two-sample or paired, because there are not two groups of one variable; not chi-square, because the variables are not categorical.)
- Hypotheses: $\beta$ is the true slope relating asking price to mileage for this model of car. $H_0\!: \beta = 0$, $H_a\!: \beta \neq 0$.
- Conditions: plots support Linear, Normal and Equal variance; a random sample from more than 250 cars, so $n = 25$ is under the 10% limit.
- Test statistic: $t = \dfrac{-0.0850}{0.0215} = -3.95$, $df = 25 - 2 = 23$, and the two-sided $p$-value is $0.0006$.
- Conclusion: $p < 0.05$, so we reject $H_0$. There is convincing evidence of a negative linear relationship between mileage and asking price for this model of used car.
从一个地区在售的某款车(多于 250 辆)中随机抽取 25 辆,记录里程 $x$(千英里)与要价 $y$(千美元)。回归输出给出 $b = -0.0850$(千美元/千英里),$SE_b = 0.0215$;图形显示条件无问题。要价与里程是否线性相关?取 $\alpha = 0.05$。
- 用哪个程序?两个变量都是定量的,在同一批车上、一个样本中测量,问题是关于线性关系,所以选择斜率的 $t$ 检验。(不是两样本或配对,因为不是同一变量的两组;也不是卡方,因为变量不是分类的。)
- 假设:$\beta$ 是该款车要价对里程的真实斜率。$H_0\!: \beta = 0$,$H_a\!: \beta \neq 0$。
- 条件:图形支持线性、正态与等方差;随机样本取自多于 250 辆的在售车,所以 $n = 25$ 未超过 10% 的限度。
- 检验统计量:$t = \dfrac{-0.0850}{0.0215} = -3.95$,$df = 25 - 2 = 23$,双侧 $p$ 值为 $0.0006$。
- 结论:$p < 0.05$,拒绝 $H_0$。有令人信服的证据表明该款二手车的里程与要价之间存在负的线性关系。
State the procedure and defend it with the data: "I will use a $t$-test for the slope because both variables are quantitative and measured on the same cars." Then write the parameter in words, the hypotheses, and the conditions that go with that procedure (LINE for a slope, expected counts for chi-square, and so on). Choosing the wrong procedure usually makes every later step wrong, so settle this decision first.
说明程序并用数据为它辩护:“因为两个变量都是定量的,且在同一批车上测量,所以我使用斜率的 $t$ 检验。”然后用文字写出参数、假设,以及该程序对应的条件(斜率用 LINE,卡方用期望计数,等等)。选错程序通常会使后面每一步都出错,所以要先把这个决定做好。
- Using a two-sample $t$-test because there are "two columns of numbers." Two variables on the same individuals call for a slope (or a paired $t$ if the question is about a mean difference), not two independent groups.
- Running a chi-square test on two quantitative variables, or a slope test on two categorical variables.
- Ignoring the conditions that belong to the chosen procedure and quoting the ones from a different test.
- 因为“有两列数”就用两样本 $t$ 检验。同一批个体上的两个变量应用斜率(若问的是均值差则用配对 $t$),而不是两个独立组。
- 对两个定量变量做卡方检验,或对两个分类变量做斜率检验。
- 忽略所选程序自己的条件,却引用另一种检验的条件。
A random sample of 50 houses records the asking price and the floor area of each. Which procedure addresses whether price is linearly related to floor area?随机抽取 50 栋房屋,记录每栋的要价与建筑面积。哪个程序可用来判断要价与建筑面积是否线性相关?
A $t$-test for the slope of the population regression line ($H_0\!: \beta = 0$, $df = 48$): two quantitative variables on the same houses.
总体回归直线斜率的 $t$ 检验($H_0\!: \beta = 0$,$df = 48$):同一批房屋上的两个定量变量。
The resting pulse of 20 volunteers is measured before and after a month of training. Which procedure estimates the mean change?测量 20 名志愿者训练一个月前后的静息脉搏。哪个程序可用来估计平均变化?
A paired $t$ interval: the same individuals are measured twice, and the parameter is the mean difference $\mu_d$.
配对 $t$ 区间:同一批个体测量两次,参数是均值差 $\mu_d$。
Each of 300 randomly chosen students is classified by grade level (4 categories) and by preferred study spot (3 categories). Which test is appropriate, and why not a slope test?随机选出的 300 名学生,各按年级(4 类)与偏好的学习场所(3 类)分类。适合哪个检验?为什么不是斜率检验?
A chi-square test for independence. Both variables are categorical and the data are counts; a slope needs two quantitative variables.
卡方独立性检验。两个变量都是分类的,数据是计数;斜率检验需要两个定量变量。
Explain why the pretest/posttest question "do scores improve on average?" is not a slope test even though each student has two scores.解释为什么即使每名学生有两个分数,“成绩平均是否提高?”这个前测/后测问题也不是斜率检验。
The parameter of interest is the mean difference $\mu_d$ between posttest and pretest, so the differences are analysed with a paired $t$ procedure. A slope would describe how the posttest score changes with the pretest score, which is a different question.
关心的参数是后测与前测的均值差 $\mu_d$,所以对差值用配对 $t$ 程序。斜率描述后测分数如何随前测分数变化,那是另一个问题。
Exam Toolkit考试工具
| If the question says | Write |
|---|---|
| Interpret the slope $b$ | For each additional [unit of $x$], the predicted [$y$] changes by $b$ [units of $y$] |
| Define $\beta$ | The true slope of the population regression line relating [$y$] to [$x$] for [population] |
| State the hypotheses | $H_0\!: \beta = 0$; $H_a\!: \beta \neq 0$, $>0$ or $<0$ in context |
| Check the conditions | Linear, Independent (with 10%), Normal, Equal variance, each tied to a plot or to the design |
| Test statistic and $p$-value | $t = b / SE_b$, $df = n - 2$, $p$-value from tails of the $t$ distribution |
| Confidence interval | $b \pm t^* SE_b$ with $df = n - 2$, then interpret in context |
| Conclusion | Compare $p$ with $\alpha$; "convincing evidence" (or not) of a linear relationship, in context |
| Can we say $x$ causes $y$? | Only if $x$ was randomly assigned; otherwise association only |
| 题目说 | 写什么 |
|---|---|
| 解释斜率 $b$ | [$x$ 的单位] 每增加一个单位,预测的 [$y$] 变化 $b$ [$y$ 的单位] |
| 定义 $\beta$ | [总体] 中 [$y$] 对 [$x$] 的总体回归直线的真实斜率 |
| 写出假设 | $H_0\!: \beta = 0$;结合情境写 $H_a\!: \beta \neq 0$、$>0$ 或 $<0$ |
| 检查条件 | 线性、独立(含 10%)、正态、等方差,各自联系到图形或设计 |
| 检验统计量与 $p$ 值 | $t = b / SE_b$,$df = n - 2$,$p$ 值取自 $t$ 分布的尾部 |
| 置信区间 | $b \pm t^* SE_b$,$df = n - 2$,然后结合情境解释 |
| 结论 | 比较 $p$ 与 $\alpha$;结合情境说有(或没有)令人信服的证据表明存在线性关系 |
| 能否说 $x$ 导致 $y$? | 只有 $x$ 是随机分配时才可以;否则只是关联 |
population regression line, population slope $\beta$, sample slope $b$, sampling distribution of $b$, standard error $SE_b$, LINE, residual plot, Normal probability plot, $df = n-2$, $t^*$, confidence interval for a slope, computer output, Coef, SE Coef, $S$, R-Sq, null hypothesis, alternative hypothesis, $p$-value, significance level, convincing evidence, linear relationship, association, causation, LinRegTInt, LinRegTTest.
总体回归直线、总体斜率 $\beta$、样本斜率 $b$、$b$ 的抽样分布、标准误 $SE_b$、LINE、残差图、正态概率图、$df = n-2$、$t^*$、斜率的置信区间、计算机输出、Coef、SE Coef、$S$、R-Sq、原假设、备择假设、$p$ 值、显著性水平、令人信服的证据、线性关系、关联、因果、LinRegTInt、LinRegTTest。
Unit FRQ: Inference for a Slope单元简答题:斜率的推断
Prompt. A random sample of 14 cars of one model is taken from the cars advertised for sale in a large region (far more than 140 cars). For each car the age $x$ in years and the asking price $y$ in thousands of dollars are recorded. The data are illustrative. A residual plot shows random scatter with no pattern, and a Normal probability plot of the residuals is close to a straight line. Regression output is shown.
| Predictor | Coef | SE Coef | T | P |
|---|---|---|---|---|
| Constant | 24.110 | 1.144 | 21.08 | 0.000 |
| Age | -1.3819 | 0.1904 | -7.26 | 0.000 |
S = 1.9347 R-Sq = 81.4% R-Sq(adj) = 79.9%
(a) State the hypotheses for a test of whether asking price is linearly related to age. (b) Verify the conditions. (c) Carry out the test at $\alpha = 0.05$. (d) Construct and interpret a 95% confidence interval for the slope. (e) A dealer says the data show that a car getting older makes its price drop. Evaluate.
| Part | What a complete answer includes |
|---|---|
| (a) | Let $\beta$ be the true slope of the population regression line relating asking price (thousand dollars) to age (years) for cars of this model advertised in the region. $H_0\!: \beta = 0$; $H_a\!: \beta \neq 0$. |
| (b) | Linear and Equal variance: the residual plot shows no pattern and steady spread. Normal: the Normal probability plot of the residuals is nearly straight. Independent: a random sample, and $14 < 10\%$ of the cars advertised (more than 140). |
| (c) | A $t$-test for the slope. $t = \dfrac{-1.3819}{0.1904} = -7.26$, $df = 14 - 2 = 12$, and the $p$-value is less than 0.001. Since $p < 0.05$, reject $H_0$: there is convincing evidence of a linear relationship between age and asking price for cars of this model advertised in the region (price falls as age rises). |
| (d) | $t^* = 2.179$ for $df = 12$. Margin $= 2.179 \times 0.1904 = 0.415$. Interval: $-1.3819 \pm 0.415 = (-1.797,\ -0.967)$. We are 95% confident that, for cars of this model advertised in the region, each additional year of age is associated with a decrease in mean asking price of between $0.967$ and $1.797$ thousand dollars (about 967 to 1,797 dollars). |
| (e) | No. Car ages were not assigned; this is an observational study, so it shows only an association. A lurking variable such as mileage rises with age and could explain the price drop. The random sample allows generalizing to cars advertised in the region. |
题目。从某大地区在售的同款车中随机抽取 14 辆(在售车远多于 140 辆)。记录每辆车的车龄 $x$(年)与要价 $y$(千美元)。数据为示例。残差图显示随机散布、无模式,残差的正态概率图接近一条直线。回归输出如下。
| Predictor | Coef | SE Coef | T | P |
|---|---|---|---|---|
| Constant | 24.110 | 1.144 | 21.08 | 0.000 |
| Age | -1.3819 | 0.1904 | -7.26 | 0.000 |
S = 1.9347 R-Sq = 81.4% R-Sq(adj) = 79.9%
(a) 写出检验要价与车龄是否线性相关的假设。(b) 验证条件。(c) 在 $\alpha = 0.05$ 下完成检验。(d) 构造并解释斜率的 95% 置信区间。(e) 一位车商说数据表明车越旧价格就越低。请评价。
| 部分 | 完整作答要点 |
|---|---|
| (a) | 设 $\beta$ 为该地区在售的此款车中,要价(千美元)对车龄(年)的总体回归直线的真实斜率。$H_0\!: \beta = 0$;$H_a\!: \beta \neq 0$。 |
| (b) | 线性与等方差:残差图无模式且散布稳定。正态:残差的正态概率图几乎是直线。独立:随机样本,且 $14 < 10\%$ 的在售车(多于 140 辆)。 |
| (c) | 斜率的 $t$ 检验。$t = \dfrac{-1.3819}{0.1904} = -7.26$,$df = 14 - 2 = 12$,$p$ 值小于 0.001。因为 $p < 0.05$,拒绝 $H_0$:有令人信服的证据表明该地区在售的此款车的车龄与要价之间存在线性关系(车龄越大,价格越低)。 |
| (d) | $df = 12$ 时 $t^* = 2.179$。误差范围 $= 2.179 \times 0.1904 = 0.415$。区间:$-1.3819 \pm 0.415 = (-1.797,\ -0.967)$。我们有 95% 的把握认为,对该地区在售的此款车,车龄每增加一年,平均要价减少 $0.967$ 到 $1.797$ 千美元之间(约 967 到 1,797 美元)。 |
| (e) | 不能。车龄不是分配的;这是观察研究,只显示关联。里程等潜在变量随车龄增加,可能解释价格下降。随机样本允许推广到该地区在售的车。 |
Common Errors and Their Corrections常见错误与修正
| Error | Correction |
|---|---|
| Writing hypotheses about $b$ | Hypotheses are about the parameter $\beta$ |
| Using $df = n-1$ | For a slope, $df = n-2$ |
| Checking Normality on the $y$-values | Check the residuals |
| Saying "the conditions are met" with no evidence | Name the plot or the design that supports each of L, I, N, E |
| Interpreting the slope without "mean" or units | For each additional unit of $x$, the mean $y$ changes by $b$ units |
| "Contains 0, so there is no relationship" | Not convincing evidence of a linear relationship; 0 is plausible but not proved |
Using the two-sided P for a one-sided test | Halve it when the sign of $b$ matches $H_a$ |
| Concluding "$x$ causes $y$" from a significant slope | Causation needs random assignment; otherwise association only |
| 错误 | 修正 |
|---|---|
| 对 $b$ 写假设 | 假设针对参数 $\beta$ |
| 使用 $df = n-1$ | 斜率的 $df = n-2$ |
| 对 $y$ 值检查正态性 | 检查残差 |
| 不给证据就说“条件满足” | 写明支持 L、I、N、E 各条件的图形或设计 |
| 解释斜率时不写“平均”或单位 | $x$ 每增加一个单位,$y$ 的均值变化 $b$ 个单位 |
| “含 0,所以没有关系” | 没有令人信服的证据表明存在线性关系;0 合理但未被证明 |
单侧检验使用双侧的 P | 当 $b$ 的符号与 $H_a$ 一致时将其减半 |
| 由显著的斜率得出“$x$ 导致 $y$” | 因果需要随机分配;否则只是关联 |
Flashcards闪卡
Select a card to reveal the answer.
点击卡片查看答案。
Unit Quiz单元自测
Choose an answer to see feedback.
选择答案查看反馈。
B. $\beta$ is the parameter; $b$ is the statistic that estimates it.
B。$\beta$ 是参数;$b$ 是估计它的统计量。
C. $df = n - 2 = 18$ because $a$ and $b$ were both estimated.
C。$df = n - 2 = 18$,因为 $a$ 与 $b$ 都是估计出来的。
B. $t = 0.512 / 0.128 = 4.0$.
B。$t = 0.512 / 0.128 = 4.0$。
B. 0 is a plausible value, so there is no convincing evidence of a linear relationship. We never prove the slope equals 0.
B。0 是合理取值,所以没有令人信服的证据表明存在线性关系。我们从不证明斜率等于 0。
C. The spread of $y$ about the line changes with $x$.
C。$y$ 围绕直线的散布随 $x$ 而变。
B. It names the confidence level, the parameter (mean change per hour) and the population.
B。它写明了置信水平、参数(每小时的平均变化)和总体。
B. Without random assignment only association is shown.
B。没有随机分配,只能说明关联。
C. $b$ agrees with $H_a$, so halve the two-sided value: 0.04.
C。$b$ 与 $H_a$ 一致,所以把双侧值减半:0.04。
D. Two quantitative variables on the same individuals and a question about a linear relationship.
D。同一批个体上的两个定量变量,问题是线性关系。
B. Random assignment supports cause and effect; the plots were not randomly selected, so the scope is limited.
B。随机分配支持因果;地块不是随机选取的,所以范围有限。
B. $1.52 \pm 2.069(0.30) = 1.52 \pm 0.62$. A uses one $SE_b$ as the margin, C uses $z^* = 1.96$ instead of $t^*$, and D uses the 99% value $2.807$.
B。$1.52 \pm 2.069(0.30) = 1.52 \pm 0.62$。A 只用一个 $SE_b$ 作误差范围,C 用了 $z^* = 1.96$ 而不是 $t^*$,D 用了 99% 的临界值 $2.807$。
B. Because $b = r\,s_y/s_x$, the two tests have the same $t$ statistic and the same $p$-value.
B。因为 $b = r\,s_y/s_x$,两个检验的 $t$ 统计量相同,$p$ 值也相同。