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.
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.
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?