答案 0 :(得分:4)
根据this post(与我的回忆相匹配),晶须的计算方式为(伪代码):
upper whisker = min(max(x), Q_3 + 1.5 * IQR)
lower whisker = max(min(x), Q_1 – 1.5 * IQR)
晶须之外的任何点均被视为离群值。
如果要检查异常点,可以分配boxplot
的输出,并根据帮助页面的建议查看out
字段:
out: the values of any data points which lie beyond the extremes of the whiskers.
类似
box <- boxplot(rnorm(100))
box$out
答案 1 :(得分:4)
使用boxplot
对象的功能:
set.seed(59737908)
x <- c(rnorm(10), 10, -55)
outliers <- boxplot(x, plot = F)$out
outliers
#[1] 10 -55
P.S。 @alan是第一位