# How do I remove outliers in dataset?

I have a data-set (185 rows) with 20 predictors and 1 dependent variable.

I have applied Cook's distance and then 4/N formula to remove some of the outliers in 1st iteration. Should I do this process until I get no outlier or it is just valid for 1st iteration? Any tips, suggestions, methods?

You should not do it at all. Unless there is reason to believe that the outliers are data entry errors, they should not be removed.

What should be done depends on what you are trying to do. It sounds like you are trying some sort of regression. First, OLS regression does not assume there are no outliers in the data - it only makes assumptions about the residuals.

However, when there are outliers methods such as quantile regression and robust regression are often better alternatives.

• +1. Note that there are many threads here on outliers discussing a variety of ways to handle them. Even quantitative criteria for identifying outliers are mostly intended to allow you to think about such data points and what to do about them, not as implying that you should delete them. – Nick Cox May 13 '16 at 11:24
• Good point . Yes my goal is to predict person hours (Dependent variable) after applying MLR into it. I thought first step would be outlier removal then MLR until I get R sqr more than 7 with good significance variables. And after it checking the model by MMRE and PRED. – Ahmad Shahwaiz May 13 '16 at 11:44
• I don't know what MMRE and PRED stand for. But your plan seems very bogus to me. It sounds like fishing. Don't remove outliers this way. – Peter Flom - Reinstate Monica May 13 '16 at 12:01
• Person-hours presumably can't be negative. For that reason and others, some generalised linear model with logarithmic link is almost certainly more appropriate than plain linear regression. The appearance of outliers here is likely to be at least in part a side-effect of using an inappropriate functional form and model. Note that with a pool of 20 predictors, a sample size of 185 implies that you should be seeking a much more parsimonious model. (Further, please don't over-use abbreviations. Like Peter I have no idea what MMRE and PRED are, and I had to work out what MLR was.) – Nick Cox May 13 '16 at 14:01

Instead of analyzing and omitting outliers, an easy approach to deal with extreme values is to use the rlm() function available in MASSpackage. rlm() fit a linear model by robust regression. lm() have fairly similar syntax to rlm().

• I'm using IBM SPSS though. Above functions are I think included in R. – Ahmad Shahwaiz May 13 '16 at 12:29
• While it is a reasonable advice for an R user - as you can see from the comment - it lacks generality. Could you expand your answer to describe what kind of model you advice and why (rather than what software)? – Tim May 13 '16 at 13:05