Re: stddev returns 0 when there is one row

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: stddev returns 0 when there is one row
Date: 2003-04-19 18:06:00
Message-ID: o233avc31o7i74e19f9vp9jshn1qms0n0r@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 19 Apr 2003 11:11:21 -0500, Bruno Wolff III <bruno(at)wolff(dot)to>
wrote:
>stddev returns 0 when the number of rows is one. I would have expected null
>to be returned in this case as the standard deviation is undefined when
>there is one row.

As far as a little googling can tell, there a two kinds of standard
deviation: Depending on whether you are calculating the standard
deviation of the *whole population* or of a *sample* you divide by N
or by (N - 1), respectively, before you take the square root.

I'm not an expert, what I say here is from
http://www.beyondtechnology.com/tips016.shtml. Other web pages seem
to say the same. OpenOffice.org Calc has two flavours of standard
deviation, too.

Servus
Manfred

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Feite Brekeveld 2003-04-19 18:29:59 Please some help on a join question with sum aggregate
Previous Message elein 2003-04-19 17:59:46 Re: mariposa