筛选异常值的方法有z-scores, modified z-score, box plots, Grubb’s test,Tietjen-Moore测试指数平滑法,Kimber测试指数分布和移动窗口滤波算法。然而比较详细的两个方法是:
Inter Quartile Range
An outlier is a point of data that lies over 1.5 IQRs below the first quartile (Q1) or above third quartile (Q3) in a given data set.
High = (Q3) + 1.5 IQR
Low = (Q1) – 1.5 IQR
Tukey Method
It uses interquartile range to filter very large or very small numbers. It is practically the same method as above except that it uses the concept of “fences”. The two values of fences are:
Low outliers = Q1 – 1.5(Q3 – Q1) = Q1 – 1.5(IQR)
High outliers = Q3 + 1.5(Q3 – Q1) = Q3 + 1.5(IQR)
在这个区域外的任何值都是异常值
当你发现异常值时,你不应该不对它进行一个定性评估就删除它,因为这样你改变了数据,使其不再纯粹。重要的是要在理解分析的背景下或者说重要的是“为什么的问题——为什么异常值不同于其他数据点?”
这个原因是至关重要的。如果归因于异常值错误,你可能把它排除,但如果他们意味着一种新趋势、模式或显示一个有价值的深度数据,你应该保留它。