Calculation of outliers

Hello,

I am trying to calculate outliers using this formula:

  1. Calculate IQR = Q3 – Q1
  2. Calculate upper fence = Q3 + (1.5 * IQR)
  3. Calculate lower fence = Q1 – (1.5 * IQR)

IQR = Interquartile Range
Q1 = Quartile 1 = Percentile 25%
Q3 = Quartile 3 = Percentile 75%

First, I tried to use the STATISTICAL AGGREGATION action to calculate Percentiles. Unfortunately, it is not possible to calculate Percentile 25% (Q1) and Percentile 75% (Q3) in the same action. We need two different actions for this. But then, I am not sure how to make a calculation based on two different actions.

Then, I tried to use CALCULATE A NEW COLUM action to calculate the complete formula. But there is no expression to calculate percentiles …

Is it possible to calculate outliers in EasyMorph?
If yes, what is the easiest way to do it?

Thanks,

Pat

Hello Pat,

Thank you for the detailed explanation. See the project below. Does it do what you wanted to achieve? It doesn’t calculate IQR, but I guess you should be able to modify the project with the IQR calculation.

outliers.morph (6.1 KB)

1 Like

Thank-you Dmitry.

The issue is that I have more than one value to peek at from my percentile table. Therefore, I would need an action where I could peek (not only 1 single value but) a series of values.

Feature suggestion:
Add a second calculation of PERCENTILE in STATISTICAL AGGREGATION. And ideally, add the Inter Quartile Range calculation too.

Pat

In this case, you can use "Merge" instead of "Peek". In a derived table, calculate the percentiles for groups defined by columns [Industry], [Region], [mGroup], etc., and then merge them back into the main table linking by the grouping columns (Industry to Industry, Region to Region, etc.).

1 Like

Oh yes. I will do that. Thanks again!

Point taken. We can move percentiles into a separate section of the action settings to allow multiple percentiles.

Also, I forgot to mention that there is a simple way to filter outliers above/below a specific percentile: use the "Keep min/max" action in the "Percent" mode. Although, it won't help in more complex scenarios such as when IQR needs to be calculated.

1 Like