0
$\begingroup$

I've performed the same measurement 20 times and I would like to remove the outliers before continuing my analysis.

The raw sample data is shown in the following figure.

Raw data

Using an algorithm I identify the most linear section between 0 and 1 on the x-axis and a perform a linear fit with the data-points in that section. The result is shown in the following figure.

Fitted data

I would now like to remove any outliers, which are "outlying" in the section I've chosen to do the fit.

My idea would be to remove those measurements differing from the mean by 3 SD, but I am unsure how to calculate any useable "mean" in this situation. Also I don't fully grasp how to take the SDs from the linear fits into account when doing this.

How do I properly remove outliers from this type of dataset?

$\endgroup$
1
  • 1
    $\begingroup$ Tukey's method is one of my favorites to remove outliers. $\endgroup$
    – enterML
    Commented Apr 10, 2017 at 10:19

1 Answer 1

0
$\begingroup$

If I understand correctly, you use the points in the 0-1 range on the $x$ axis to fit a line and then extrapolate that line beyond $x=1$? This is not very sound statistically. The statistical model is valid only in the range of data used to fit it.

From your data it seems that variance increases with $x$ (the lines diverge with x) so the model doesn't satisfy the assumption of homoskedasticity. Therefore it is much harder to find resuduals that are larger than 3 SD.

If homoskedasticity assmumption holds then the variance of the residuals is constant dependent on $x$. Therefore you just have to calculate standard error of residuals and remove observations with residuals larger than 3 SD. So you don't need to calculate the mean. Linear regression itself gives you the mean value of $y$ given $x$:

$$E(y_i)=\beta_0+\beta_1 x_i$$

But in general I don't think your approach to the matter at hand is very sound.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.