Re: how to identify outliers - Mailing list pgsql-general

From John R Pierce
Subject Re: how to identify outliers
Date
Msg-id 4AE7891F.8080402@hogranch.com
Whole thread Raw
In response to how to identify outliers  ("Rhys A.D. Stewart" <rhys.stewart@gmail.com>)
Responses Re: how to identify outliers
List pgsql-general
Rhys A.D. Stewart wrote:
> Hey all,
> I have the following table:  data(pnum text, distance float8, route text).
> I would like to remove the outliers in distance, i.e. lets say i get
> the avg dist of pnum for each route and the std deviation of the
> distance what is the best way to identify the outliers?
>

i dunno.  brute force, two passes, one to identify the MIN and MAX of
the values, then another SELECT avg(value) ....   WHERE (....) AND val
!= minval AND val != maxval.

you could probably do something with a standard deviation that is more
accurate for large sets than just tossing the 2 outliers.





pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: auto truncate/vacuum full
Next
From: Tatsuo Ishii
Date:
Subject: Re: PHP + PDO + PGPOOL = Segmentation fault