如何从R中的箱线图中提取异常值 [英] How to extract outliers from box plot in R

查看:176
本文介绍了如何从R中的箱线图中提取异常值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您能否解释一下是否有办法从箱线图中提取异常值.我绘制了一个箱线图,我只想提取异常值.

Could you explain me if there is a way to extract outliers from box plot. I have plotted a box plot and I want to extract only the outliers.

这是箱线图的代码.

# melting down
require(reshape)
melt_nx <- melt(nx, id.vars = c("x", "y"))
boxplot(data = melt_nx, main = "NX", value ~ variable, las = 2,    
par(mar = c(15, 5, 4, 2) + 0.1),
names = c("We1", "We2", "we3"))

是否可以仅从箱线图中提取异常值?

Is it possible from the box plot to extract the outliers only?

推荐答案

boxplot 函数返回一个列表,其中一个节点名称为out".这些都是超越胡须"的价值观.我不知道如何在参数列表中执行 par 但如果你想要这些特定的值,那么使用这个:

The boxplot function returns a list with one of it node-names as "out". These are the values that are beyond the "whiskers". I don't know about executing par within the argument list but if you want these particular values, then use this:

vals <- boxplot(data = melt_nx, main = "NX", value ~ variable, las = 2,    
      names = c("We1", "We2", "we3"))
vals$out

并阅读所有这些帮助页面:

And do read all these help pages:

?boxplot
?boxplot.stats
?bxp
?fivenum

这篇关于如何从R中的箱线图中提取异常值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆