Statistics: Refine function for outlier detection