Skip to content

Inference for Quantitative Data: Slopes

AP Statistics Topic 9 7:59 English narration · English + 中文 subtitles burned in

space play · ←/→ 5s · j/l 10s · f fullscreen · ,/. speed

Chapters

Transcript
Here is one class on a scatterplot: hours of revision along the bottom, test score up the side. 这是一个班级的散点图:横轴是复习时间,纵轴是考试成绩。
The line of best fit climbs. 最佳拟合直线是上升的。
But this is only one class. 但这只是一个班级。
Take a different group and the points move, so the line tilts. 换一组学生,点的位置就会变,直线也会倾斜得不一样。
The real question is not what this one line does. It is whether the relationship behind it is real at all. 真正的问题不是这一条直线画成什么样,而是它背后的关系到底是不是真实存在的。
Unit nine does inference for slopes in four steps. 第九单元用四步对斜率做推断。
Why the slope of a sample line is a statistic, not a fact. 为什么样本直线的斜率是一个统计量,而不是事实。
A confidence interval for the true slope. 真实斜率的置信区间。
A test of whether the true slope is zero. 检验真实斜率是否为零。
And last, the skill the exam rewards most: choosing the right procedure. 最后是考试最看重的能力:选出正确的那一个方法。
First, where a slope comes from. 先看斜率是怎么来的。
The red lines are the residuals: how far each point sits above or below the line. 红色的线段是残差:每个点在直线上方或下方偏离了多远。
The computer slides the line until the total of the squared residuals is as small as possible. 计算机不断移动这条直线,直到残差平方的总和达到最小。
That is the least-squares regression line, and its slope is what this unit is about. 这就是最小二乘回归直线,它的斜率正是本单元要研究的那个数。
Now picture the whole population of students, with one true line hidden inside it. 现在想象学生的整个总体,里面藏着一条真实的直线。
You never get to see that line. 你永远看不到它。
You take a sample, fit a line, and its slope is your estimate. 你抽取一个样本,拟合一条直线,它的斜率就是你的估计值。
Take another sample, and the points move, so the slope changes. 再抽一个样本,点变了,斜率也就变了。
Do it again, and again, and again, and the slopes pile up into a shape. 一次又一次地重复,这些斜率会堆成一个形状。
Look where the pile sits: it is centred on the true slope. 看这堆分布的中心:它正好落在真实斜率上。
That pile is the sampling distribution of the sample slope — sampling variability in one picture. 这一堆就是样本斜率的抽样分布—— 一幅图里的抽样变异性。
How wide is that pile? 这一堆有多宽?
Its width is the standard error of the slope. 它的宽度就是斜率的标准误差。
A small sample gives a wide pile: your one slope could land a long way from the truth. 样本小,这一堆就宽: 你手上的这一个斜率可能离真值很远。
A larger sample pulls the pile in tight, so the standard error is smaller. 样本大,这一堆就收紧,标准误差也就更小。
That is why more data gives a narrower interval. 这正是数据越多、区间越窄的原因。
You read these numbers; you never compute them. 这些数字你只要会读,不用自己算。
Here is the output from twenty students. 这是二十名学生的输出结果。
First, find the row for the explanatory variable — here, hours of revision. 先找到解释变量所在的那一行——这里是复习时长。
The first number column is the sample slope: two point five marks for every extra hour. 第一列数字是样本斜率: 每多复习一小时,成绩多两点五分。
The next column is its standard error: zero point eight. 下一列是它的标准误差:零点八。
After that comes the test statistic, and the last column is the p-value. 再往后是检验统计量,最后一列是P值。
The output does not print the degrees of freedom: for a slope, the sample size minus two — twenty minus two, eighteen. 输出不会给你自由度: 对斜率来说,就是样本量减二——二十减二,等于十八。
Before any interval or test, check five conditions. 在做任何区间或检验之前,先检查五个条件。
Their first letters spell the word Liner. 它们的首字母拼成 Liner 这个词。
Linear — the true relationship really is a straight line. 线性——真实关系确实是一条直线。
Independent — the observations do not affect each other, and the sample is under ten percent of the population. 独立——各次观测互不影响,而且样本不超过总体的百分之十。
Normal — the residuals are roughly normal. 正态——残差大致服从正态分布。
Equal spread — the residuals spread the same amount all along. 等方差——残差在整条线上的离散程度一样。
Random — the data came from a random sample or experiment. 随机——数据来自随机抽样或随机化实验。
The residual plot checks two of those letters. 残差图用来检查其中两个条件。
Plot the residuals against the explanatory variable. 把残差对解释变量作图。
On the left, a formless cloud around zero: linear looks fine. 左边是围绕零的一团无规律散点:线性看起来没问题。
In the middle, a clear curve: the relationship is not a straight line. 中间是一条明显的曲线: 这个关系并不是直线。
On the right, a fan opening out: the spread is not equal. 右边像扇子一样张开:离散程度不相等。
Either of those, and the slope procedure cannot be trusted. 只要出现后两种情况,斜率的方法就不可信了。
And this is why you must always look. 这也正是你必须亲眼看图的原因。
These four data sets have the same correlation and the same line of best fit. 这四组数据的相关系数相同,最佳拟合直线也相同。
Only the first is really linear. 只有第一组是真正线性的。
The second bends. 第二组是弯的。
The third is straight except for one outlier. 第三组除了一个离群点以外是直的。
In the fourth, a single far-away point decides the whole line. 第四组里,一个孤零零的远点决定了整条直线。
Now the interval itself. 现在来看区间本身。
Remember what ninety five percent means. 记住百分之九十五是什么意思。
Sample after sample, each one gives its own interval. 一个又一个样本,每个都给出自己的区间。
About ninety five out of every hundred capture the true value — here, a true mean. 每一百个这样的区间里,大约有九十五个能罩住真实值——这里是真实的均值。
A few miss, in red, and you never know which kind yours is. 有几个会落空,用红色表示,而你永远不知道你手上的属于哪一种。
For a slope, the promise is exactly the same. 对斜率来说,这个保证完全一样。
So, a ninety five percent interval for the true slope. 那么,来求真实斜率的百分之九十五置信区间。
Start from the output: the slope is two point five, its standard error is zero point eight, from twenty points. 从输出结果出发:斜率是二点五, 标准误差是零点八,一共二十个点。
Degrees of freedom: twenty minus two, eighteen. 自由度:二十减二,等于十八。
The critical value for ninety five percent confidence with eighteen degrees of freedom is two point one zero one. 在百分之九十五的置信水平、十八个自由度下,临界值是二点一零一。
The margin of error is that critical value times the standard error: one point six eight. 误差幅度等于临界值乘以标准误差:一点六八。
So the interval runs from zero point eight two to four point one eight. 所以区间从零点八二到四点一八。
Say it in context: we are ninety five percent confident that each extra hour of revision is worth between zero point eight two and four point one eight marks. 要结合背景表述:我们有百分之九十五的把握认为, 每多复习一小时,成绩会多零点八二到四点一八分。
Look at where that interval sits, because zero is the number that matters. 看这个区间落在哪里,因为零才是关键的那个数。
A slope of zero would mean a flat line: the explanatory variable tells you nothing. 斜率为零意味着一条水平线: 解释变量什么也告诉不了你。
Our interval lies entirely above zero, so zero is not plausible: the relationship is real and positive. 我们的区间完全在零的上方,所以零是不合理的: 这就有证据说明存在真实的正向关系。
If an interval stretched across zero, a flat line is still plausible and you can claim nothing. 如果一个区间横跨了零, 那么水平线仍然有可能,你什么结论都不能下。
And if it lay entirely below zero, the relationship is real and negative. 如果区间完全在零的下方,那么关系是真实的,而且是负向的。
A test asks the same question another way. 检验用另一种方式问同一个问题。
Assume the null hypothesis: the slope is zero, no linear relationship at all. 先假设原假设成立:斜率为零,完全没有线性关系。
Then your sample slope should scatter around zero like this. 那么你的样本斜率就应该像这样围绕零散布。
Mark where your result landed. 标出你的结果落在哪里。
The p-value is the area in the tail beyond it — the chance of a result this extreme if the null were true. P值就是它之外那条尾巴的面积——如果原假设为真,得到这么极端结果的概率。
For a two-sided alternative, count both tails. 如果备择假设是双侧的,两条尾巴都要算。
Now carry the test out on the same output. 现在用同一份输出结果来做检验。
The null hypothesis: the true slope is zero. 原假设:真实斜率为零。
The alternative: it is not zero. 备择假设:它不等于零。
Conditions: the residual plot was a formless cloud and the sample was random, so Liner holds. 条件:残差图是一团无规律的散点,样本也是随机的,所以 Liner 条件成立。
The test statistic is the slope minus zero, divided by its standard error: two point five over zero point eight is three point one three, with eighteen degrees of freedom. 检验统计量等于斜率减去零,再除以它的标准误差:二点五除以零点八等于三点一三, 自由度是十八。
That gives a p-value of about zero point zero zero six, below zero point zero five, so we reject the null hypothesis. 由此得到的P值约为零点零零六,小于零点零五,所以我们拒绝原假设。
In context: there is convincing evidence that revision time and test score are linearly related. 结合背景来说:有充分的证据表明,复习时间与考试成绩之间存在线性关系。
Watch the tails — one trap the exam sets. 盯住两条尾巴——这里有一个考试常设的陷阱。
Computer output always prints the two-tailed p-value, the one for a not-equal alternative. 计算机输出的永远是双侧P值, 也就是"不等于"那种备择假设对应的值。
If your alternative is one-sided — greater than, or less than — you halve it. 如果你的备择假设是单侧的——大于或者小于—— 就要把它除以二。
But check the direction first. 但先要检查方向。
If the sample slope points the opposite way to your alternative, the one-sided p-value is above one half, and you cannot reject anything. 如果样本斜率指向的方向和你的备择假设相反, 那么单侧P值会大于零点五,你什么也拒绝不了。
By now you have a whole toolbox, and the last skill is choosing from it. 到现在你已经有了一整套工具,最后一项本领就是从中挑出正确的那个。
Across all of inference, identify how many samples and which design. 在所有推断中,先弄清有多少个样本、是哪种设计。
Read the type of data first. 先看数据的类型。
Categorical, one or two samples: a proportion procedure. 分类数据,一个或两个样本:用比例的方法。
Quantitative: a mean procedure, one sample, two samples, or paired. 数量数据:用均值的方法, 单样本、双样本或配对。
A table of counts: chi-squared. 计数表格:用卡方。
Two quantitative variables on the same individuals: the slope procedure you learned today. 同一批个体上测量的两个数量变量:就用你今天学的斜率方法。
Four marks students lose here. 这里有四个学生常丢的分。
One: if the interval includes 0, you cannot claim a linear relationship — the variables may still be related in a curved way. 第一:如果区间包含 0,你就不能声称存在线性关系—— 两个变量仍然可能是曲线关系。
Two: the degrees of freedom are the sample size minus two, not minus one. 第二:自由度是样本量减二,不是减一。
Three: halve the printed p-value only when the alternative is one-sided. 第三:只有当备择假设是单侧时,才把打印出来的P值除以二。
Four: every conclusion goes back into context, with units. 第四:所有结论都要回到具体背景,并带上单位。

Log in or create account

IGCSE, A-Level & AP