# What is a mathematical way to define a point on a scatter plot as an outlier?

I have a graph and there are two points that could be two potential outliers. I'm trying to create a polynomial line of best fit with undefined order.

I believe I could use a >2 standard deviations exclusion rule, but I'm sure how exactly this is applied. Do I determine the qualifiying standard deviation by using all the points initially?

That's what I did, but I have two points that qualify for exclusion. Do I remove both at once or one at a time? If I remove only the one with the greatest deviation from the line of best fit, I can recalculate the line and it will give me a new line of best fit of new polynomial order. If this new fit is used, the other point which was previously an outlier is no longer an outlier.

What is the correct procedure?

-
What is the number of dimensions of your dataset? What statistical model are you fitting? (an outlier is defined wrt to a model). Give more details. As formulated the question doesn't make sense. – user603 Apr 16 '12 at 20:52

Without knowing everything about your data or what your project is, it's hard to suggest what the "right" method is. A better way to think about it is probably that either method may work, but that you need transparency in how you did it when you present your results.

If you are removing two outliers from 10,000, I don't think it particularly matters either way. If you are removing two outliers from 10 records, it becomes significantly more important!

In general, if you are using a 2SD method, I would say you should remove both of them at the same time - you set the exclusion criteria, and then you remove everything that doesn't fit it. It does not seem to me that you have any analytic justification for the other approach - why would you remove one and then recalculate?

With that said - if the outlying data points don't have extreme leverage on your model, or are generally unobtrusive, do you think it's necessary to even remove them? I usually suggest not dropping observations unless they are severely disruptive to modeling. HTH!

-
What you're saying makes sense. I'm working with a smaller data set (it's for a physical chemistry lab) and while the numbers could justify removal of these two points, removal of both at the same time would not significantly alter the line of best fit. Thanks – Chad Apr 16 '12 at 20:47
If you're using a 2SD criterion to remove values from 10,000, you will likely be removing hundreds of them, not just two. Such a criterion is a poor one for identifying genuine outliers. – whuber Apr 16 '12 at 21:18
I wish I could down-vote more. If you are removing two outliers from 10,000 this statement is a false and misleading. As a matter of fact, most classical statistical models (including incidentally the ones you cite) have an unbounded influence functions meaning that a single outliers suffice to pull the resulting fits arbitrarily far away from the model best fitting the remainder of the data. – user603 Dec 27 '12 at 17:48
@user603 I'm not sure I understand the specific criticism that you have. I was responding to a rather abstract question, as I think you noted in a comment on the question. My point in this answer was mostly: a) there was not enough information about the dataset to make any specific recommendations, b) the amount of outliers vs. the total number of observations is of significance, and c) unless the outliers have a serious effect on your modeling, it might not be worth removing them. I didn't "cite" any models and didn't intend to offer any specific guidance. gung did that below. – TARehman Jan 11 at 18:40
@user603 Also, if you have a better answer, I think it would help the asker more to write it up and post it, rather than to make a comment on mine. I can see why you are saying that my point is false, but my point wasn't that the amount of leverage was different, but rather that taking 2/10 observations out of your sample removes a lot more data than 2/10000. – TARehman Jan 11 at 18:43

You want to look at robust regression techniques. The excellent UCLA website offers tutorials using several different software, so you could explore that and hopefully find a method that you can use with your software of choice. Generally, the strategy is to use a different loss function than the typical least squares loss function. There are a large number of different possibilities, but Tukey's bisquare is probably the most common. Simply eliminating data beyond 2SD's is, in fact, to use a form of altered loss function (when viewed from a very abstract mathematical perspective), but one with less desirable properties.

-