📚 Topic 5: Regression | 主题5:回归
Regression analysis is a fundamental statistical tool in IB Mathematics that allows us to model the relationship between two numerical variables. By fitting a line of best fit to a set of data points, we can make predictions, assess trends, and quantify the strength of linear associations. This article covers the core concepts, formulas, and interpretations required for your IB exam, including correlation coefficients, least-squares regression, residuals, and the coefficient of determination.
回归分析是IB数学中一种基本的统计工具,用于对两个数值变量之间的关系进行建模。通过给一组数据点拟合一条最佳拟合线,我们可以进行预测、评估趋势并量化线性关联的强度。本文涵盖了IB考试所需的核心概念、公式和解释,包括相关系数、最小二乘回归、残差以及决定系数。
1. What is Regression? | 什么是回归?
Regression examines how a dependent (response) variable changes when an independent (explanatory) variable is varied. The goal is to find a mathematical equation that best describes the data and can be used to estimate unknown values. In IB, we focus on linear regression, which assumes the relationship can be modelled by a straight line.
回归研究的是当自变量(解释变量)变化时,因变量(响应变量)如何变化。其目标是找到一个最能描述数据的数学方程,并可用于估计未知值。在IB中,我们主要关注线性回归,它假定了这种关系可以用一条直线来建模。
s the y-intercept and b is the slope of the line. The independent variable is usually plotted on the x-axis and the dependent variable on the y-axis. Not all relationships are linear, but linear regression is a powerful starting point.
最简单的形式是简单线性回归模型:y = a + bx,其中 a 是y轴截距,b 是直线的斜率。自变量通常绘制在x轴上,因变量绘制在y轴上。并非所有关系都是线性的,但线性回归是一个强有力的起点。
2. Scatter Diagrams and Correlation | 散点图与相关性
Before fitting a regression line, we always begin with a scatter diagram. By plotting each pair (x, y) as a point, we can visually assess whether a linear model is appropriate. The pattern of points indicates the direction, form, and strength of the relationship.
在拟合回归线之前,我们总是从散点图开始。通过将每一对 (x, y) 绘制为一个点,我们可以直观地评估线性模型是否合适。点的分布模式表明了关系的方向、形式和强度。
Correlation refers to the degree of linear association between the two variables. A positive correlation means that as x increases, y tends to increase; a negative correlation means that as x increases, y tends to decrease. The Pearson product-moment correlation coefficient, denoted by r, provides a numerical measure of this linear correlation lying between -1 and 1.
相关性是指两个变量之间线性关联的程度。正相关意味着随着 x 增加,y 倾向增加;负相关意味着随着 x 增加,y 倾向减少。皮尔逊积矩相关系数,记作 r,给出了一个介于 -1 和 1 之间的线性相关程度的数值度量。
Values of r close to 1 indicate a strong positive linear correlation, values near -1 indicate a strong negative linear correlation, and values near 0 suggest little or no linear correlation. It is crucial to understand that correlation does not imply causation.
r 值接近 1 表示强正线性相关,接近 -1 表示强负线性相关,接近 0 表示几乎没有线性相关。理解相关关系并不意味着因果关系至关重要。
3. The Regression Line and Least-Squares Method | 回归线与最小二乘法
sible. This approach is called the least-squares method. The line is given by the equation ŷ = a + bx, where ŷ represents the predicted value of y for a given x.
y 对 x 的回归线是使得数据点到该直线的垂直距离的平方和尽可能小的直线。这种方法称为最小二乘法。该直线由方程 ŷ = a + bx 给出,其中 ŷ 表示给定 x 时 y 的预测值。
Two important properties of the least-squares regression line: it always passes through the point (x̄, ȳ), where x̄ and ȳ are the means of the x and y data sets, respectively. The slope b is calculated first, then the intercept a is derived from the means.
最小二乘回归线有两个重要性质:它总是经过点 (x̄, ȳ),其中 x̄ 和 ȳ 分别是 x 和 y 数据集的均值。首先计算斜率 b,然后根据均值推导出截距 a。
4. Formulas for the Regression Coefficients | 回归系数的公式
For a data set consisting of n pairs (xᵢ, yᵢ), the slope b and intercept a of the regression line y on x can be computed using these formulas:
对于由 n 对数据 (xᵢ, yᵢ) 组成的数据集,y 对 x 的回归线的斜率 b 和截距 a 可以使用以下公式计算:
b = Sxy / Sxx
其中 Sxy = Σ(xᵢ − x̄)(yᵢ − ȳ) = Σxᵢyᵢ − (Σxᵢ)(Σyᵢ)/n
Sxx = Σ(xᵢ − x̄)² = Σxᵢ² − (Σxᵢ)²/n
a = ȳ − b x̄
Alternatively, many students use the built-in functions of their graphical display calculator (GDC) to obtain a, b, and r directly. In the IB exam, you must be able to perform these calculations both manually for small data sets and using a GDC for larger ones.
或者,许多学生使用图形显示计算器(GDC)的内置函数直接求得 a、b 和 r。在IB考试中,你必须既能对小型数据集手工计算,也能利用GDC处理较大数据集。
0, though this may not always have practical meaning if x = 0 lies outside the data range.
斜率 b 表示 x 每增加一个单位时 y 的估计变化量。截距 a 给出了当 x = 0 时 y 的预测值,但如果 x = 0 超出数据范围,它可能没有实际意义。
5. Interpreting the Regression Output | 解读回归输出
Once you have obtained the equation ŷ roblem. For example, if a regression line for exam scores (y) against hours studied (x) is ŷ = 45 + 8x, we can say: "For every additional hour studied, the exam score is predicted to increase by 8 marks."
一旦你得到了方程 ŷ = a + bx,就必须结合问题的背景解释这些值。例如,如果考试分数 (y) 对学习小时数 (x) 的回归线是 ŷ = 45 + 8x,我们可以说:“每多学习一小时,考试分数预计提高 8 分。”
Be careful with units: the slope carries the units of y per unit of x. The intercept carries the same units as y. Also, avoid extrapolation – using the model to predict values far outside the range of observed x-values can lead to unreliable results.
注意单位:斜率带有 y 的单位除以 x 的单位的量纲。截距的单位与 y 相同。还要避免外推——使用模型预测远超出观测 x 值范围的值可能导致不可靠的结果。
6. Residuals and Their Analysis | 残差及其分析
ed y-value and the corresponding predicted value from the regression line: residual = yᵢ − ŷ ssessing the fit of the model and checking whether the linear regression assumptions hold.
残差是观测 y 值与回归线对应预测值之间的差:残差 = yᵢ − ŷᵢ。残差对于评估模型的拟合程度以及检验线性回归假设是否成立至关重要。
If a linear model is appropriate, the residuals should be randomly scattered around zero when plotted against the fitted values or against x. A residual plot showing a clear curve or a funnel shape indicates that the linear model may not be suitable or that the variability is not constant.
如果线性模型合适,当残差相对拟合值或 x 作图时,应随机分散在零附近。如果残差图呈现出明显的弯曲或漏斗形状,则表明线性模型可能不合适,或者变异性不是常数。
You can also use residuals to identify outliers – points with unusually large residuals. In IB exam questions, you might be asked to sketch a residual plot and comment on the appropriateness of the linear model based on its pattern.
你还可以利用残差来识别异常值——具有异常大残差的点。在IB考试题目中,你可能会被要求画出残差图,并根据其形态评论线性模型是否合适。
7. Pearson's Correlation Coefficient in Detail | 皮尔逊相关系数详解
The Pearson correlation coefficient r can be expressed in a form that relates to Sxy, Sxx, and the corresponding sum of squares for y (Syy):
皮尔逊相关系数 r 可以表示为与 Sxy、Sxx 以及相应的 y 的平方和 (Syy) 相关的形式:
r = Sxy / √Sxx × Syy
其中 Syy = Σ(yᵢ − ȳ)² = Σyᵢ² − (Σyᵢ)²/n
A crucial link to regression is that the slope b can be written as b = r × (sy / sx), where sy and sx are the sample standard deviations of y and x. This shows that the sign of r determines the sign of b, and that the magnitude of r relates to how tightly points cluster around the regression line.
与回归的一个关键联系是,斜率 b 可以写成 b = r × (sy / sx),其中 sy 和 sx 分别是 y 和 x 的样本标准差。这表明 r 的符号决定了 b 的符号,而 r 的大小与数据点围绕回归线的密集程度相关。
bivariate data set, always state both the value and the strength of the correlation (e.g., "r = 0.92 indicates a very strong positive linear correlation"). Ensure you do not round r too aggressively during calculations.
在报告双变量数据集的 r 时,要同时说明数值和相关的强度(例如,“r = 0.92 表明存在很强的正线性相关”)。计算过程中要确保不要对 r 过早进行过度四舍五入。
8. Coefficient of Determination (R²) | 决定系数 (R²)
nt variable that is explained by the independent variable. For example, R² = 0.81 means 81% of the variation in y is accounted for by the linear relationship with x.
决定系数 R² 就是相关系数的平方(对于简单线性回归)。它被解释为因变量总变异中被自变量所解释的比例。例如,R² = 0.81 意味着 y 中 81% 的变异可由与 x 的线性关系来解释。
Note that R² is always between 0 and 1, and it gives a more direct measure of how useful the regression model is for prediction. Even if r is high, a small R² might occur if the spread of points is still large relative to the slope.
注意 R² 始终介于 0 和 1 之间,它可以更直接地衡量回归模型对预测的有用程度。即使 r 很高,如果点的分散程度相对于斜率仍然很大,R² 也可能很小。
In IB questions, you may be asked to calculate R² from a given r, or to comment on the meaning of a given R² value. It is also possible to obtain R² directly from the GDC regression output.
在IB题目中,你可能会被要求从给定的 r 计算 R²,或者评论给定 R² 值的含义。也可以直接从 GDC 回归输出中获取 R²。
9. Assumptions for Linear Regression | 线性回归的假设
The simple linear regression model relies on several assumptions that should be checked before making inferences. The key assumptions can be summarised with the mnemonic LINE:
简单线性回归模型依赖于几个假设,在做出推断之前应加以检验。关键假设可用记忆口诀 LINE 来概括:
Linearity: the relationship between x and y is linear.
线性性:x 和 y 之间的关系是线性的。
Independence: the observations are independent of each other.
独立性:各观测值彼此独立。
Normality: for any fixed x, the y-values are normally distributed.
正态性:对于任何固定的 x,y 值呈正态分布。
Equal variance: the variability of y is the same for all values of x.
等方差性:对于所有 x 值,y 的变异性相同。
ul>
r regression line of the form y = a + bx minimises the sum of squared vertical deviations.
形如 y = a + bx 的线性回归线最小化了垂直偏差的平方和。
The slope b is given by Sxy / Sxx, and the line always passes through the mean point (x̄, ȳ).
斜率 b 由 Sxy / Sxx 给出,且该直线始终经过均值点 (x̄, ȳ)。
Pearson's r measures the strength and direction of linear correlation; r² is the proportion of variation explained.
皮尔逊 r 度量线性相关的强度和方向;r² 是被解释的变异比例。
Residual plots are essential for checking regression assumptions; look for random scatter without patterns.
残差图对于检验回归假设至关重要;要寻找无模式的随机散布。
Master GDC procedures and transformation techniques for non-linear data to succeed in IB exams.
掌握 GDC 操作程序以及非线性数据的变换技巧,以便在IB考试中取得成功。
In IB, the most common checks are using a scatter plot for linearity and a residual plot for equal variance and randomness. Formal hypothesis tests on the slope are mostly found in HL content.
在IB中,最常见的检验是使用散点图检验线性性,使用残差图检验等方差性和随机性。有关斜率的正式假设检验多出现在HL内容中。
10. Regression Lines with Transformed Variables | 含变量变换的回归线
one or both variables to produce a linear relationship. For an exponential model y = k × aˣ, taking the logarithm gives log y = log k + x log a, which is linear in log y against x.
有时散点图显示的是非线性模式,例如指数增长或幂函数关系。在这种情况下,我们可以对一个或两个变量进行变换,以产生线性关系。对于指数模型 y = k × aˣ,取对数可得 log y = log k + x log a,这相对于 x 在 log y 上是线性的。
a log-log transformation (log y against log x) yields a straight line. IB exam papers may ask you to identify an appropriate transformation, perform linear regression on transformed data, and then back-transform to find the original model parameters.
类似地,对于幂函数模型 y = k × xⁿ,可通过双对数变换(log y 对 log x)得到一条直线。IB试卷可能会要求你识别适当的变换,对变换后的数据进行线性回归,然后反向变换求出原始模型参数。
These techniques appear in both Analysis and Approaches (AA) and Applications and Interpretation (AI) courses, with AI placing more emphasis on modelling with real data and technology.
这些技巧出现在分析与方法(AA)和应用与解释(AI)两门课程中,AI 更侧重于用真实数据和技术进行建模。
11. Using GDC for Regression Analysis | 使用图形计算器进行回归分析
GDC skills are an integral part of IB Mathematics. To perform linear regression on most GDC models, you enter the x and y data into two lists, then select the linear regression (LinReg) function. The output typically includes a, b, r, and sometimes r².
图形计算器技能是IB数学不可或缺的一部分。要在大多数GDC型号上进行线性回归,你需要将 x 和 y 数据输入两个列表,然后选择线性回归 (LinReg) 函数。输出通常包括 a、b、r,有时还包括 r²。
You should be able to produce a scatter plot with the superimposed regression line, and use the calculator to predict a y-value for a given x-value. Ensure you know how to store the regression equation to evaluate predicted values without rounding intermediate coefficients.
你应该能够生成带回归线的散点图,并使用计算器为给定的 x 值预测 y 值。确保你知道如何存储回归方程,以便在不四舍五入中间系数的情况下计算预测值。
In exam settings, remember to write down both the equation obtained from the GDC with all given decimal places (or to three significant figures as appropriate) and the correlation coefficient to support your answers.
在考试情境中,记得写出从GDC得到的方程(保留所有给定位的小数,或视情况保留三位有效数字)以及相关系数,以支持你的答案。
12. Summary — Key Takeaways | 总结——核心要点
Published by TutorHao | IB Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图