首页 > 解决方案 > 只有一条胡须线的箱线图?

问题描述

我想在两个不同的地方比较一个变量。为此,我在 R 中使用了以下代码:

boxplot(variable~place)

因为我的地方有两个层次。但是,我得到了一个看起来很奇怪的箱形图。你知道似乎是什么问题吗? 在此处输入图像描述

标签: rboxplot

解决方案


正如评论中所指出的,箱线图没有任何问题。每个只有一个胡须的事实反映了您的数据。

箱线图是一种非常有指导意义的图形:它们不仅显示数据的位置和分布,而且还指示偏度。箱线图的解释取决于它的“语法”,即它的主要图形元素。有五个这样的元素:

1. bold horizontal line: depicts the median (the middle value of a sorted distribution)
2. box: represents the interquartile range (IQR)
3. whiskers: separate values lying outside the IQR (but still somewhat typical of the data) from outliers
3. empty circles: depict outliers (values surprisingly large or small given all values considered)
4. notches (optional): give a rough impression of the significance of the difference between the medians

那么,每个箱线图中只有一个晶须的事实是,由于数据的极端偏斜:在箱的情况下,1上限是 IQR 的上限,在箱的情况2存在没有小于中位数的值

希望这可以帮助。


推荐阅读