📚 Regression Line | 回归线
When exploring relationships between two numerical variables, we often look for patterns that allow us to make predictions. A regression line, also known as the line of best fit, is a powerful statistical tool that models such a relationship, giving us a simple linear equation to summarise the data. In IB Mathematics, mastering the regression line means you can connect scatter plots to equations, interpret slopes and intercepts in real contexts, and critically evaluate how well a model describes the data.
在探索两个数值变量之间的关系时,我们经常寻找能够进行预测的模式。回归线,也称为最佳拟合线,是一种强大的统计工具,用于对这种关系建模,为我们提供了一个简单的线性方程来总结数据。在 IB 数学中,掌握回归线意味着你能将散点图与方程联系起来,能在实际情境中解释斜率和截距,并批判性地评估模型对数据的描述程度。
1. Introduction to Regression Analysis | 回归分析导论
Regression analysis is a statistical method for investigating the relationship between a response variable (often denoted y) and an explanatory variable (x). The goal is to find a mathematical function that describes how y changes when x varies. In linear regression, we assume this relationship can be approximated by a straight line, making the model easy to interpret and apply.
回归分析是一种研究响应变量(通常记为 y)与解释变量 (x) 之间关系的统计方法。目标是找到一个数学函数,描述 y 如何随 x 变化。在线性回归中,我们假设这种关系可以用一条直线近似,使得模型易于解释和应用。
The simplest form is simple linear regression, where we have one predictor and one response. Once the regression line is determined, it can be used for prediction, hypothesis testing, and understanding the strength of association.
最简单的形式是简单线性回归,此时只有一个预测变量和一个响应变量。一旦确定了回归线,它就可以用于预测、假设检验以及理解关联强度。
2. Scatter Plots and Correlation | 散点图与相关性
Before fitting a regression line, we always start with a scatter plot. This graph displays each data point as a coordinate (x, y) and reveals the direction, form, and strength of the relationship. A roughly linear pattern suggests that a straight line might be appropriate.
在拟合回归线之前,我们总是从散点图开始。该图将每个数据点显示为坐标 (x, y),并揭示关系的方向、形式和强度。大致呈线性的模式表明直线可能是合适的。
Correlation, measured by Pearson’s product-moment correlation coefficient r, quantifies the linear association. The value of r ranges from -1 to +1. A positive r indicates that as x increases, y tends to increase; a negative r indicates an inverse relationship. The closer |r| is to 1, the stronger the linear correlation. However, correlation does not imply causation, nor does a high r guarantee that a linear model is the best choice.
相关性通过皮尔逊积矩相关系数 r 来量化线性关联。r 的取值范围是 -1 到 +1。正 r 表示 x 增大时 y 倾向于增大;负 r 表示反向关系。|r| 越接近 1,线性相关性越强。然而,相关不意味着因果关系,高 r 也不能保证线性模型是最佳选择。
3. The Least Squares Regression Line | 最小二乘回归线
The most common method for fitting a straight line to bivariate data is the method of least squares. This technique minimises the sum of the squares of the vertical distances (residuals) between the observed y-values and the line. The resulting line is called the least squares regression line of y on x.
拟合二元数据直线的最常用方法是最小二乘法。该技术最小化观测 y 值与直线之间的垂直距离(残差)的平方和。由此产生的直线称为 y 对 x 的最小二乘回归线。
The equation can be written as ŷ = a + bx or y = a + bx, where ŷ (y-hat) denotes the predicted value, a is the y-intercept, and b is the slope. In IB, the form y = a + bx is widely used with the understanding that b represents the gradient.
该方程可以写成 ŷ = a + bx 或 y = a + bx,其中 ŷ(y-hat)表示预测值,a 是 y 轴截距,b 是斜率。在 IB 中,y = a + bx 的形式被广泛使用,其中 b 表示斜率。
ŷ = a + bx
where b = r × (sy ÷ sx) and a = ȳ − b x̄
Here, x̄ and ȳ are the means of the x and y data, and sx and sy are the sample standard deviations. r is the Pearson correlation coefficient.
这里,x̄ 和 ȳ 分别是 x 和 y 数据的平均值,sx 和 sy 是样本标准差,r 是皮尔逊相关系数。
4. Calculating the Regression Line Formula | 计算回归线公式
While the IB syllabus expects you to use a GDC (Graphic Display Calculator) for most regression calculations, understanding the formulas deepens your insight. The slope b can also be calculated using the sum of products of deviations:
虽然 IB 大纲要求你使用图形计算器 (GDC) 进行大多数回归计算,但理解公式能加深你的洞察力。斜率 b 也可以使用离差积和来计算:
b = Σ ( (x − x̄)(y − ȳ) ) ÷ Σ ( (x − x̄)2 )
This expression shows that the slope is a ratio of the covariance of x and y to the variance of x. The intercept a is then found by plugging the mean point (x̄, ȳ) into the line equation because the least squares line always passes through the point of means.
这个表达式表明,斜率是 x 与 y 的协方差与 x 的方差之比。然后,通过将平均值点 (x̄, ȳ) 代入直线方程来求得截距 a,因为最小二乘线总是穿过平均值点。
For example, given five data points with x̄ = 10, ȳ = 25, sx = 4, sy = 6 and r = 0.8, we can compute:
例如,给定五个数据点,x̄ = 10、ȳ = 25、sx = 4、sy = 6、r = 0.8,我们可以计算:
b = 0.8 × (6 ÷ 4) = 1.2
a = 25 − 1.2 × 10 = 13
ŷ = 13 + 1.2x
5. Interpreting Slope and Intercept in Context | 在上下文中解释斜率和截距
A key skill in IB is interpreting the regression coefficients within the context of the problem. The slope b represents the estimated change in the response variable y for a one-unit increase in the explanatory variable x. The intercept a is the estimated value of y when x = 0. However, the intercept only has meaning if x = 0 is within the observed range of the data and makes practical sense.
IB 的一个关键技能是在问题情境中解释回归系数。斜率 b 表示当解释变量 x 增加一个单位时,响应变量 y 的估计变化量。截距 a 是 x = 0 时 y 的估计值。但只有当 x = 0 处于观测数据范围内且具有实际意义时,截距才有意义。
For instance, in a study of study hours (x) and exam score (y), a slope of 5.3 means each additional hour of study is associated with an increase of 5.3 marks on average. If the intercept is 40, and x = 0 hours is plausible, then a student who studies zero hours can expect to score 40.
例如,在一项关于学习时长 (x) 和考试成绩 (y) 的研究中,斜率为 5.3 表示平均每多学习一小时,成绩提高 5.3 分。如果截距为 40,且 x = 0 小时是可信的,那么不学习的学生预计可得 40 分。
6. Making Predictions Using the Regression Line | 使用回归线进行预测
Once the regression equation is obtained, we can plug in a given x-value to produce a predicted y-value. This prediction is valid only if the relationship remains linear and the model assumptions hold. It is essential to differentiate between exact values and predictions, which carry uncertainty.
一旦获得回归方程,我们可以代入给定的 x 值以产生预测的 y 值。只有当关系保持线性且模型假设成立时,这种预测才有效。必须区分精确值和带有不确定性的预测值。
When using a GDC, after running a linear regression, you can use the stored equation to predict y for any x, often through a ‘predict’ feature or by typing the function manually.
使用 GDC 时,运行线性回归后,你可以使用存储的方程来预测任意 x 对应的 y,通常通过“预测”功能或手动键入函数来实现。
7. Extrapolation vs. Interpolation | 外推与内插
Predictions made within the range of the original x-values are called interpolations; these are generally reliable. Predictions beyond the range of the data are extrapolations. Extrapolation is risky because the linear trend observed might not continue outside the observed interval. IB exam questions often ask you to comment on the reliability of predictions based on this distinction.
在原始 x 值范围内进行的预测称为内插;这些通常是可靠的。超出数据范围的预测是外推。外推是有风险的,因为观察到的线性趋势可能在观察区间外不会持续。IB 考试题目经常要求你基于这一区分评论预测的可靠性。
For example, if the x-values range from 10 to 50, predicting y for x = 30 is interpolation, while predicting for x = 100 is extrapolation and should be treated with caution.
例如,如果 x 值的范围是 10 到 50,那么预测 x = 30 时的 y 是内插,而预测 x = 100 时的 y 是外推,应谨慎对待。
8. Residuals and Residual Plots | 残差与残差图
A residual is the vertical deviation between an observed data point and the regression line: e = yobserved − ŷ. Residuals help us assess the fit of the model. A residual plot graphs residuals on the y-axis against either the predicted values or the x-values.
残差是观测数据点与回归线之间的垂直偏差:e = yobserved − ŷ。残差帮助我们评估模型的拟合度。残差图将残差绘制在 y 轴上,对应预测值或 x 值。
If the linear model is appropriate, the residuals should be randomly scattered around zero with no clear pattern, constant spread, and no extreme outliers. Patterns such as a curve suggest a non-linear relationship. A funnel shape indicates non-constant variance (heteroscedasticity), which violates regression assumptions.
如果线性模型合适,残差应随机散布在零附近,没有明显模式,散布恒定,且没有极端异常值。曲线等模式表明存在非线性关系。漏斗形状表示方差不恒定(异方差性),违反了回归假设。
9. Assessing the Fit: The Coefficient of Determination | 评估拟合度:决定系数
The coefficient of determination, denoted r2, measures the proportion of the total variation in the y-variable that is explained by the linear relationship with x. Expressed as a percentage, r2 × 100% tells you how much of the variability in y can be accounted for by the model.
决定系数,记为 r2,衡量的是 y 变量的总变异中由与 x 的线性关系所解释的比例。以百分比表示,r2 × 100% 告诉你模型可以解释 y 变异的多少。
| r | r2 | Interpretation | 解释 |
| 0.9 | 0.81 | 81% of variation in y is explained by x | y 81% 的变异由 x 解释 |
| 0.5 | 0.25 | Only 25% of variation explained | 仅解释 25% 的变异 |
Even with a high r2, always check the residual plot before declaring a good fit, because a high r2 can sometimes be achieved with a curved pattern.
即使 r2 很高,也必须检查残差图再宣称拟合良好,因为高 r2 有时可能伴随曲线模式。
10. Regression with the GDC (TI-Nspire/ Casio) | 使用图形计算器进行回归
IB exams expect fluency in performing linear regression on a GDC. Typically, you enter the data into lists, set up a scatter plot, and then choose the linear regression option. The output provides a, b, r, and r2. On TI-Nspire, use the Lists & Spreadsheet application, then Statistics → Stat Calculations → Linear Regression (mx+b). For Casio, from the Main Menu, go to Statistics, enter data, then Calc → Regression → Linear Reg.
IB 考试要求熟练使用 GDC 进行线性回归。通常,你将数据输入列表,设置散点图,然后选择线性回归选项。输出提供 a、b、r 和 r2。在 TI-Nspire 上,使用“Lists & Spreadsheet”应用程序,然后 Statistics → Stat Calculations → Linear Regression (mx+b)。对于 Casio,从主菜单进入 Statistics,输入数据,然后 Calc → Regression → Linear Reg。
Remember to store the regression equation as a function (e.g., f1(x)) so you can quickly compute predictions and draw the line on the scatter plot. In the exam, always write the full equation with coefficients rounded to a sensible number of decimal places.
记住将回归方程存储为一个函数(如 f1(x)),以便快速计算预测值并将直线绘制在散点图上。在考试中,始终写出完整方程,系数圆整到合理的小数位数。
11. Common Pitfalls and Causation | 常见误区与因果关系
A common mistake is to blindly trust a regression line without checking the underlying assumptions. Outliers can greatly influence the slope and intercept, leading to a misleading model. Investigate whether an outlier is a genuine data point or an error, and consider removing it only with justification.
一个常见的错误是盲目相信回归线而不检查基础假设。异常值会极大地影响斜率和截距,导致误导性的模型。要调查异常值是真实数据点还是错误,只有在有正当理由时才考虑移除它。
Causation is another critical pitfall. A strong linear relationship and a high r2 do not prove that changes in x cause changes in y. There could be lurking variables or the association could be coincidental. IB questions frequently ask you to distinguish correlation and causation.
因果关系是另一个关键误区。强线性关系和高 r2 并不能证明 x 的变化会导致 y 的变化。可能存在潜在变量,或者关联可能是巧合。IB 题目经常要求你区分相关和因果关系。
Also, remember that the regression line of y on x is different from the regression line of x on y. The line that minimises squared vertical distances for y on x is not the same as the one that minimises squared horizontal distances. When asked to predict y from x, always use the y on x line.
此外,请记住,y 对 x 的回归线与 x 对 y 的回归线不同。最小化 y 对 x 垂直距离平方和的直线与最小化水平距离平方和的直线并不相同。当要求从 x 预测 y 时,始终使用 y 对 x 的回归线。
12. Summary and IB Exam Tips | 总结与 IB 考试技巧
The regression line is a cornerstone of bivariate data analysis. To excel in IB, be able to: produce a scatter plot, calculate the Pearson correlation r, find the least squares regression line using a GDC, interpret a and b in context, compute predicted values, distinguish interpolation from extrapolation, construct and interpret residual plots, and critically evaluate the model using r2 and residuals.
回归线是双变量数据分析的基石。为了在 IB 中取得优异成绩,需要能够:绘制散点图,计算皮尔逊相关系数 r,使用 GDC 求最小二乘回归线,在情境中解释 a 和 b,计算预测值,区分内插和外推,构建和解释残差图,并使用 r2 和残差批判性地评估模型。
When answering a regression question, always state the regression equation with the variables named (e.g., Score = 13 + 1.2 × Hours). Check that predictions make sense, and comment on reliability, especially when extrapolating. Write a brief conclusion that connects the statistical result to the real-world context. Finally, practise with past papers to become comfortable with the varied ways regression concepts are tested.
回答回归问题时,始终用变量名写出回归方程(例如,Score = 13 + 1.2 × Hours)。检查预测是否合理,并评论可靠性,特别是在进行外推时。撰写简短结论,将统计结果与现实世界背景联系起来。最后,通过历年真题练习,熟悉回归概念的各种考查方式。
Published by TutorHao | IB Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply