Subject | Re: [firebird-support] Re: Standard Deviation calculation using select query ? |
---|---|
Author | unordained |
Post date | 2005-07-13T20:58:22Z |
First of all, I'm a dork. STDDEV uses the mean, not the median, and mean is the same as average. So
you do have the aggregate for that. My stats prof. would be ashamed.
Divide by count(x) if you're considering the STDDEV to be relative to the population (STDDEV of
exactly the rows you're looking at), divide by count(x)-1 if you're considering the STDDEV to be
relative to a sample of the population (STDDEV of more than the data you have -- extrapolating for
the general case).
-Philip
---------- Original Message -----------
From: "Ann W. Harrison" <aharrison@...>
you do have the aggregate for that. My stats prof. would be ashamed.
Divide by count(x) if you're considering the STDDEV to be relative to the population (STDDEV of
exactly the rows you're looking at), divide by count(x)-1 if you're considering the STDDEV to be
relative to a sample of the population (STDDEV of more than the data you have -- extrapolating for
the general case).
-Philip
---------- Original Message -----------
From: "Ann W. Harrison" <aharrison@...>
> Ali Gökçen wrote:------- End of Original Message -------
> >
> > if i remember correctly, STDDEV is:
> >
> > if(count(x)>1)
> > sqrt ( sum((x-avg(x))*(x-avg(x))) / (count(x)-1) )
> >
>
> or
> > if(count(x)>1)
> > sqrt ( sum((x-avg(x))*(x-avg(x))) / (count(x)) )
>
> Regards,
>
> Ann