calculating the outliers in R

前端 未结 5 1647
慢半拍i
慢半拍i 2020-12-05 01:21

I have a data frame like this:

x

Team 01/01/2012  01/02/2012  01/03/2012  01/01/2012 01/04/2012 SD Mean
A     100         50           40        NA           


        
5条回答
  •  悲哀的现实
    2020-12-05 02:10

    The following formulas could be used to determine which values are outliers:

    upper.outlier.calc <- function(x.var, df){
      with(df, quantile(x.var, 0.75) + (1.5 * (quantile(x.var, 0.75) - quantile(x.var, 0.25))))
    }
    
    lower.outlier.calc <- function(x.var, df){
      with(df, quantile(x.var, 0.25) - (1.5 * (quantile(x.var, 0.75) - quantile(x.var, 0.25))))
    }
    

提交回复
热议问题