← 返回资讯屏轩教育 · 行业资讯

Topic 5: Regression | 主题5:回归

2026-08-03 03:18 · 本文部分内容由AI辅助创作

📚 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考试题目中,你可能会被要求画出残差图,并根据其形态评论线性模型是否合适。


广告 / Sponsored

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 来概括: