Re: [GENERAL] how to identify outliers

2009-10-28 Thread Sam Mason
Rhys A.D. Stewart wrote: I would like to remove the outliers in distance As others have said; an outlier is normally a human call and not something that's generally valid to do automatically. The operator would probably want to go in and look to see why it's that far out and either fix the

Re: [GENERAL] how to identify outliers

2009-10-28 Thread Chris Spotts
I'd agree, stddev is probably best and the following should do something reasonable for what the OP was asking: SELECT d.* FROM data d, ( SELECT avg(distance), stddev(distance) FROM data) x WHERE abs(d.distance - x.avg) x.stddev * 2; [Spotts, Christopher] Statistically

[GENERAL] how to identify outliers

2009-10-27 Thread Rhys A.D. Stewart
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? Rhys. -- Sent via

Re: [GENERAL] how to identify outliers

2009-10-27 Thread Rhys A.D. Stewart
Im asking how to get the ones that dont fall near the avg so for example lets say i have the following distances: 10,11,12,11,10,9,9,10,11,12,10,11,99 then 99 would be an outlier. the avg would be like 16 or 17 i reckon with the 99. so i want a way to find aan outlier, remove it and then

Re: [GENERAL] how to identify outliers

2009-10-27 Thread Alvaro Herrera
Rhys A.D. Stewart escribió: i did some seraching about outliers and most of hits are about R or spss or some other statistical package.so looking for a way to do it wholly in pgsql. Well, then, maybe PL/R? -- Alvaro Herrerahttp://www.CommandPrompt.com/

Re: [GENERAL] how to identify outliers

2009-10-27 Thread Scott Bailey
Rhys A.D. Stewart wrote: Im asking how to get the ones that dont fall near the avg so for example lets say i have the following distances: 10,11,12,11,10,9,9,10,11,12,10,11,99 then 99 would be an outlier. the avg would be like 16 or 17 i reckon with the 99. so i want a way to find aan

Re: [GENERAL] how to identify outliers

2009-10-27 Thread John R Pierce
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