Re: variance aggregate function incorrect? Reference Materials reg create aggregate - Mailing list pgsql-sql

From Tom Lane
Subject Re: variance aggregate function incorrect? Reference Materials reg create aggregate
Date
Msg-id 18525.1024933165@sss.pgh.pa.us
Whole thread Raw
In response to variance aggregate function incorrect? Reference Materials reg create aggregate  (Joseph Syjuco <joseph@asti.dost.gov.ph>)
List pgsql-sql
Joseph Syjuco <joseph@asti.dost.gov.ph> writes:
> i needed the variance function ... i dont know if i introduced the wrong
> parameters or maybe this variance is not the variance that im looking
> for but it doesnt provide the right results

> variance=(nEx^2 - (Ex)^2)/(n(n-1))

That's what I'd expect it to do, all right.  Please define "doesnt
provide the right results".
        regards, tom lane




pgsql-sql by date:

Previous
From: Marcos Garcia
Date:
Subject: Slow SELECT with distinct, in a TIMESTAMP type column
Next
From: Tom Lane
Date:
Subject: Re: assign count() result to a declared variable in plpgsql