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

Boxplots | 箱线图

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

📚 Boxplots | 箱线图

Boxplots, or box-and-whisker plots, are a fundamental tool in descriptive statistics used to display the distribution of a dataset based on a five-number summary. In the IB Mathematics curriculum, particularly in Analysis & Approaches and Applications & Interpretation, understanding and interpreting boxplots is essential for data analysis topics. This article will guide you through the construction, interpretation, and application of boxplots, ensuring you are well-prepared for your exams.

箱线图,又称盒须图,是描述性统计中基于五数概括来展示数据分布的基本工具。在IB数学课程中,尤其是分析与方法和应用与解释课程,理解并解读箱线图是数据分析专题的关键。本文将指导你完成箱线图的构建、解读和应用,帮助你为考试做好充分准备。

1. What is a Boxplot? | 什么是箱线图?

A boxplot is a standardised way of displaying the distribution of data based on the five-number summary: minimum, first quartile (Q₁), median (Q₂), third quartile (Q₃), and maximum. It consists of a rectangular “box” from Q₁ to Q₃, with a line inside marking the median. Whiskers extend from the box to the minimum and maximum values, provided there are no outliers. When outliers are present, they are plotted as individual points beyond the whiskers.

箱线图是一种基于五数概括(最小值、第一四分位数Q₁、中位数Q₂、第三四分位数Q₃和最大值)来显示数据分布的标准化方式。它由一个从Q₁到Q₃的矩形“箱子”组成,内部有一条线标记中位数。在无异常值的情况下,触须从箱子延伸到最小值和最大值。当存在异常值时,异常值会被绘制为触须之外的独立点。

This graphical tool provides a quick visual summary of the centre, spread, and skewness of the data, making it especially helpful for comparing multiple datasets side by side.

该图形工具可以快速直观地总结数据的中心、离散度和偏度,尤其适合并排比较多组数据集。


2. The Five-Number Summary | 五数概括法

The five-number summary consists of the minimum, first quartile (Q₁), median (Q₂), third quartile (Q₃), and maximum. To find these values, the data must first be sorted in ascending order. The median splits the dataset into two halves; Q₁ is the median of the lower half, and Q₃ is the median of the upper half. The minimum and maximum are the smallest and largest values, but when outliers are present, modified boxplots use the adjacent values within the fences instead.

五数概括包括最小值、第一四分位数Q₁、中位数Q₂、第三四分位数Q₃和最大值。要找到这些数值,必须先将数据按升序排列。中位数将数据集分成两半,Q₁是下半部分数据的中位数,Q₃是上半部分数据的中位数。最小值和最大值分别是最小和最大的数据点,但当存在异常值时,改良箱线图会用界限内的相邻值来替代。


3. Calculating Quartiles | 计算四分位数

For IB examinations, the most common method for finding quartiles is to first locate the median, then take the median of the lower half of the data for Q₁ and the median of the upper half for Q₃. When the total number of data points n is odd, the median itself is excluded from both halves; when n is even, the two halves are simply split around the centre.

在IB考试中,最常用的四分位数计算方法是先找到中位数,然后取数据下半部分的中位数作为Q₁、上半部分的中位数作为Q₃。当数据总数为奇数时,中位数本身不计入两半;当n为偶数时,数据直接在中心分成两半。

: {5, 7, 8, 9} → Q₁ = (7+8)/2 = 7.5. Upper half: {12, 15, 18, 22} → Q₃ = (15+18)/2 = 16.5.

奇数n示例:数据集{5, 7, 8, 9, 10, 12, 15, 18, 22}。中位数为第5个值10。下半部分:{5, 7, 8, 9} → Q₁ = (7+8)/2 = 7.5。上半部分:{12, 15, 18, 22} → Q₃ = (15+18)/2 = 16.5。

. Median = (6+8)/2 = 7. Lower half: {2, 4, 6} → Q₁ = 4. Upper half: {8, 10, 12} → Q₃ = 10.

偶数n示例:{2, 4, 6, 8, 10, 12}。中位数 = (6+8)/2 = 7。下半部分:{2, 4, 6} → Q₁ = 4。上半部分:{8, 10, 12} → Q₃ = 10。


4. Constructing a Boxplot | 绘制箱线图

To draw a boxplot, first compute the five-number summary. Then draw a horizontal (or vertical) scale and mark the positions of Q₁, Q₂ and Q₃. Draw a rectangular box from Q₁ to Q₃, and add a vertical line inside the box at the median. Extend whiskers from the box to the minimum and maximum, or to the most extreme data points within the outlier fences if using a modified boxplot. Finally, plot any outliers as individual points, often using small circles or crosses.

要绘制箱线图,首先计算五数概括。然后画一条水平(或垂直)标尺,标出Q₁、Q₂和Q₃的位置。从Q₁到Q₃画一个矩形箱,并在箱内中位数处画一条垂直线。从箱子两端延伸触须至最小值和最大值,若使用改良箱线图则触须延伸至位于异常值界限内的最远数据点。最后将任何异常值单独绘制为点,通常用小圆圈或叉号表示。

Using the previous odd‑n dataset, the boxplot would have a box from 7.5 to 16.5, a median line at 10, and whiskers extending to the minimum 5 and the maximum 22. No outliers are present.

以前面奇数数据集为例,箱线图的箱体从7.5到16.5,中位线在10,触须分别延伸至最小值5和最大值22。不存在异常值。


5. Identifying Outliers | 识别异常值

data point outside these fences is considered an outlier and should be plotted separately.

异常值是远离数据主体的数据点。标准规则将异常值定义为任何低于Q₁−1.5×IQR或高于Q₃+1.5×IQR的数值,其中IQR = Q₃ − Q₁。下界 = Q₁ − 1.5 × IQR,上界 = Q₃ + 1.5 × IQR。任何落在这些界限之外的数据点都被视为异常值,应单独绘制。

lue 20 exceeds 12, so it is an outlier. In the boxplot, the upper whisker extends to 6 (the largest non‑outlier), and 20 is marked as an outlier point.

考虑数据集:{1, 2, 3, 4, 5, 6, 20}。Q₁ = 2, Q₃ = 6, IQR = 4。下界 = 2 − 6 = −4,上界 = 6 + 6 = 12。数值20超过12,因此它是一个异常值。箱线图中,上触须延伸到6(最大的非异常值),20被标记为异常值点。


6. Interpreting the Box and Whiskers | 解读箱体和触须

The box itself represents the interquartile range (IQR), which contains the middle 50% of the data. The median line shows the centre of the distribution. The whiskers indicate the overall spread outside the middle half. A longer whisker on one side suggests possible skewness or the presence of outliers. When comparing boxplots, look at the positions of the medians, the lengths of the boxes and whiskers, and the number of outliers to assess differences in central tendency and variability.

箱体本身代表四分位距(IQR),包含了中间50%的数据。中位线显示了分布的中心。触须表明中间一半之外的整体散布情况。某一侧的触须较长可能暗示偏度或异常值的存在。在比较箱线图时,观察中位数的位置、箱体和触须的长度以及异常值的数量,以评估集中趋势和变异性的差异。


广告 / Sponsored

7. Skewness and Boxplots | 偏度与箱线图

A symmetric distribution will have a median roughly in the centre of the box, and the two whiskers will be of similar length. In a right‑skewed (positively skewed) distribution, the median is closer to Q₁, the right half of the box is longer, and the upper whisker extends further than the lower whisker. For a left‑skewed (negatively skewed) distribution, the median is nearer to Q₃, the left half of the box is longer, and the lower whisker is longer. Outliers are more common on the stretched side.

对称分布的中位数大致位于箱体中央,两侧触须长度相近。在右偏(正偏)分布中,中位数靠近Q₁,箱子的右半部分较长,上触须比下触须延伸得更远。在左偏(负偏)分布中,中位数靠近Q₃,箱子的左半部分较长,下触须更长。异常值在拉长的这一侧更为常见。

For example, income data often produces a right‑skewed boxplot: most earnings are moderate, but a few very high incomes pull the upper whisker and create a long right tail.

例如,收入数据常产生右偏箱线图:大多数收入适中,但少数极高的收入拉长了上触须,形成长长的右尾。


8. Comparing Distributions | 比较分布

Side‑by‑side boxplots are extremely useful for comparing two or more groups. When analysing IB exam questions that present multiple boxplots, you should comment on the medians (which group has the higher centre), the IQRs and overall range (which group is more spread out), the skewness, and any outliers. Always use comparative language such as “the median of Group A is greater than that of Group B, indicating a generally higher performance.”

并排箱线图在比较两组或多组数据时极为有用。在分析IB考试中展示多组箱线图的题目时,你应当评论中位数(哪一组中心更高)、IQR和全距(哪一组更分散)、偏度以及任何异常值。始终使用比较性的语言,例如“A组的中位数大于B组,这表明总体表现更高”。

Keep in mind that a boxplot does not show the mean, the mode, or the shape of the distribution in fine detail; it only displays the five‑number summary.

请记住,箱线图不展示均值、众数或分布的具体形状细节;它只呈现五数概括。


9. Modified Boxplots | 改良箱线图

QR of the quartiles. Values beyond the fences are flagged as outliers and plotted individually. This approach gives a more realistic picture of the data by separating unusual observations from the bulk of the distribution.

标准箱线图的触须延伸至绝对最大值和最小值。改良箱线图是IB数学中的首选形式,它的触须仅延伸至位于四分位数1.5×IQR范围内的最远数据点。超出界限的值被标记为异常值并单独绘制。这种方法通过将异常观测值从数据主体中分离出来,更真实地展示了数据。


10. Boxplots in the IB Curriculum | IB课程中的箱线图

Boxplots appear in Topic 4: Statistics and Probability of both IB Mathematics Analysis & Approaches (AA) and Applications & Interpretation (AI). Students are expected to construct boxplots from raw data, from frequency tables, and from cumulative frequency graphs. Examination questions often ask you to interpret a given boxplot, identify the five‑number summary, detect outliers, and compare two datasets using boxplots. Some questions may also require you to deduce which statements are true or false based solely on a boxplot representation.

箱线图出现在IB数学分析与方法(AA)和应用与解释(AI)的共同主题4:统计与概率中。学生需要能够根据原始数据、频率表和累积频率图绘制箱线图。考试题目经常要求你解读给定的箱线图,识别五数概括,检测异常值,以及使用箱线图比较两个数据集。有些题目可能还要求你仅根据箱线图推断哪些陈述是正确的或错误的。


11. Common Mistakes and Tips | 常见错误与技巧

Common mistakes: forgetting to sort the data before finding quartiles; including the median in both halves when n is odd; using the absolute min and max as whisker endpoints even when outliers exist; confusing the length of the box with the number of observations (the box shows IQR, not frequency); and failing to discuss spread or skewness when comparing boxplots.

常见错误:在找四分位数前忘记排序;数据总数n为奇数时将中位数同时计入上下半部分;即使存在异常值仍用绝对最小值和最大值作为触须端点;将箱体长度与观测值个数混淆(箱体显示的是IQR而非频数);在比较箱线图时未能讨论离散度或偏度。

Exam tips: ck for outliers; when comparing, structure your answer around centre, spread, shape and unusual features; and double‑check whether you are expected to draw a standard or modified boxplot.

考试技巧:始终对数据排序;清晰标出尺度;使用1.5×IQR规则检查异常值;在比较时,围绕中心、离散度、形状和异常特征来组织答案;并仔细确认题目要求绘制的是标准还是改良箱线图。


12. Practice Example | 练习题示例

Dataset: 18, 22, 25, 27, 28, 30, 32, 35, 38, 42, 105. Construct a modified boxplot and describe the distribution.

数据集:18, 22, 25, 27, 28, 30, 32, 35, 38, 42, 105。绘制一个改良箱线图并描述分布。

Solution: r fence = 38 + 1.5 × 13 = 57.5. The value 105 > 57.5, so it is an outlier. The maximum non‑ 0, lower whisker to 18, upper whisker to 42, and outlier at 105. The distribution is right‑skewed with a high outlier.

解答:排序数据:18, 22, 25, 27, 28, 30, 32, 35, 38, 42, 105。n = 11。中位数 = 30(第6个值)。下半部分:{18, 22, 25, 27, 28} → Q₁ = 25。上半部分:{32, 35, 38, 42, 105} → Q₃ = 38。IQR = 38 − 25 = 13。下界 = 25 − 1.5 × 13 = 5.5;上界 = 38 + 1.5 × 13 = 57.5。数值105 > 57.5,因此它是异常值。最大非异常值为42,最小值为18。箱子从25到38,中位线在30,下触须至18,上触须至42,异常值标注在105处。分布为右偏且存在一个高端异常值。

Published by TutorHao | 数学 Revision Series | aleveler.com

广告 / Sponsored
IBDP国际文凭计算机科学学生用书 高级及标准水平 Computer Science for the IB Diplo…
计算机 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥524.0

更多咨询请联系16621398022(同微信)

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao