我试图摆脱包含箱线图和蜂群的图表中的异常值。
我使用以下代码创建箱线图:
boxplot(Lead_s ~ Group, data = g, outline = FALSE,
main = 'Gaze shift duration with co-occuring movement units',
horizontal=TRUE,xlab = "Gaze lead (sec)")
随着outline=FALSE
我的异常值消失。
然后,我运行此代码以获取蜂群形式的数据点。
beeswarm(Lead_s ~ Group, data = g, col = 4, pch = 16,
add = TRUE,horizontal=TRUE,pwcol = 1 + as.numeric(Lead_s))
蜂群的箱线图:
会发生什么是outliers
在图表之外绘制的。无论我是否添加outline=FALSE
,异常值仍然存在。
这是我绘制的数据样本:
Group Lead_s
Non-Performers 1
Non-Performers 3
Expert 18
Non-Performers 0.1
Non-Performers 0.1
Non-Performers 0.1
Non-Performers 0.2
Non-Performers 0.2
Non-Performers 0.3
Expert 0.4
Non-Performers 0.4
Non-Performers 0.4
Expert 0.5
Non-Performers 0.5
Non-Performers 0.6
Non-Performers 0.6
Non-Performers 0.7
Expert 0.8
Non-Performers 0.8
Expert 1.1
Expert 1.1
Non-Performers 1.1
Expert 1.3
Non-Performers 1.3
Non-Performers 1.4
Non-Performers 1.4
Non-Performers 1.4
Non-Performers 1.5
Expert 1.7
Expert 1.9
Non-Performers 1.9
Expert 2.1
Non-Performers 2.1
Non-Performers 2.1
Non-Performers 2.1
Non-Performers 2.3
Expert 2.5
Expert 2.7
Expert 2.7
Non-Performers 3.1
Expert 4.1
Expert 4.5
Non-Performers 5.6
Non-Performers 6.7
有什么想法可以解决吗?