Skip to content
Prev 274950 / 398506 Next

How to remove multiple outliers

Did you read the documentation for ?outlier. It clearly states that it
removes the single (possibly repeated) value with the largest distance
from the mean. That's only 10099 here....you could perhaps apply the
function more than once or write your own outlier removal script using
whatever criterion you want to define outliers, but the function is
doing exactly what it claims to do.

On another note, why complicate things? Just use the rm.outlier()
function of the same package rather than doing it (inefficiently) how
you are currently. Note that outlier() returns a logical vector which
can be used for direct subsetting; that there's no need to test
booleans ==TRUE (since that's an identity transform on the set of
booleans), and that the arr.ind = TRUE call isn't needed here. None of
those make much of a difference for this problem, but they are points
of good practice.

Michael
On Thu, Oct 20, 2011 at 8:11 AM, aajit75 <aajit75 at yahoo.co.in> wrote: