我是一個初學者,通常使用R和R包。 我想問問下面是否有任何明確的解決方案。我已經導入我的.csv格式的數據,你可以在下面的圖片如何使用IQR方法去除/消除異常值
https://dl.dropboxusercontent.com/u/23801982/1234.jpg
這些分組由實體年月數據,並且對4個參數,你可以在接下來的列看的見。如果還產生了例如Absrtactions列如下:
https://dl.dropboxusercontent.com/u/23801982/1234566.jpg
現在,我試圖找出我與boxplot.stats命令做了異常值。
但我不知道如何消除結果中的異常值,並將它們導出到新文件(例如.txt或.csv)中,這歸因於分組數據。我還看到了使用IQR進行計算的手動外部方式,但我認爲它不適合所需的可導出數據集。
我迄今爲止所使用的代碼是:
rm(list = ls())
library("gdata")
s1 <- read.csv("C:\\Users\\G\\Documents\\R\\Projects\\20141125.csv", header = T)
boxplot(s1$Abstractions ~ s1$Entity, col="green", srt=45)
boxplot.stats(s1$Abstractions)
謝謝
歡迎來到StackOverflow!請閱讀有關如何生成[最小可重現示例]的信息(http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610#5963610)。這會讓其他人更容易幫助你。 – Jaap 2014-11-25 14:05:42
[在R中輕鬆移除異常值]的可能重複(http://stackoverflow.com/questions/15160485/removing-outliers-easily-in-r) – Jaap 2014-11-25 14:09:16