Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: ryehIn the 'Profiling and Patterns' library, we have 'Band by Deviation' and 'Band by Strata' nodes. Here I present a 'Band by Quartiles' option. This can be useful for various statistical calculations. I created it so I could look for outliers. One common way to do so is to calculate the quartiles, then the inter-quartile range (IQR), and look for points greater than Q3 + 1.5*IQR or less than Q1 - 1.5*IQR.
In this example, I am providing a crude way of finding the quartiles. I use the Quick Stats node to determine the number (call it N) of data points, then use a counter to determine the values at N/4, N/2, and 3*N/4. From the outputs, you can get the quartile values, as well as which quartile each data is in - either 1, 2, 3 or 4. There is an output for the data set with the outliers removed. And an output for just the (non-null) outliers.
The example data I used - 1, 2, 3, 4, 5, 6, 7, 8 - shows that 1 and 2 are in the first quartile, 3 and 4 in the second quartile, and so on. There are no outliers in this case. If we change the 8 to 80 (so 1, 2, 3, 4, 5, 6, 7, 80), then the 80 is flagged as an outlier.
Attachments:
Band_by_Quartiles.brg