Subject | Re: Standard Deviation calculation using select query ? |
---|---|
Author | mario1fb |
Post date | 2005-07-12T23:00:15Z |
Thank you Philip for clarification. Most appreciated. At least I know
now that STDDEV cannot be calculated using the Interbase SQL query.
BTW, 'in the old DOS days' this task could be done with just a single
line of code, e.g. in FoxPro database:
CALC CNT(), AVG(INDEX), STD(INDEX) TO aCNT, aAVG, aSTD
and the result was calculated in a split of a second, no indexes
required ...
It appears that I will now have to write the whole complex procedure
in Delphi to extract the data from the table, place them in the memory
array, and finally use the Delphi built in functions to calculate the
STDDEV, in order to achieve the same result.
Unless, as Philip suggested, someone has done this better already ?...
Any suggestions would be most welcome.
Regards,
Mario
--- In firebird-support@yahoogroups.com, "unordained"
<unordained_00@c...> wrote:
now that STDDEV cannot be calculated using the Interbase SQL query.
BTW, 'in the old DOS days' this task could be done with just a single
line of code, e.g. in FoxPro database:
CALC CNT(), AVG(INDEX), STD(INDEX) TO aCNT, aAVG, aSTD
and the result was calculated in a split of a second, no indexes
required ...
It appears that I will now have to write the whole complex procedure
in Delphi to extract the data from the table, place them in the memory
array, and finally use the Delphi built in functions to calculate the
STDDEV, in order to achieve the same result.
Unless, as Philip suggested, someone has done this better already ?...
Any suggestions would be most welcome.
Regards,
Mario
--- In firebird-support@yahoogroups.com, "unordained"
<unordained_00@c...> wrote:
> Since nobody else is replying to this ...you would need in order to
>
> a) No, it's not an available aggregate function, nor is the MEAN()
> calculate the STDDEV manually.Interbase and Firebird don't
>
> b) No, you can't add it as a user-defined-function (UDF) because
> expose an API by which your own functions could get multiple rows ofdata. (I learned this when I
> asked about a product-aggregate instead of an additive-aggregate.)pretty much leaves you writing a
>
> So if it's not built-in, and you can't add it as a UDF, then that
> stored procedure (SP). I'm terrible at writing SP's, so you'll wantto get help from someone else.
> It's possible someone already has one written. A very quick googlesearch isn't turning one up.
>
> -Philip
>
> ---------- Original Message -----------
> From: "mario1fb" <mario1fb@y...>
>
> > Interbase alows for quick calculation of Sum, Average, etc. using
> > simple select statement:
> > e.g.
> > select AVG(INDEX), SUM(INDEX) from DATATABLE
> >
> > Is there a way of calculating Standard Deviation (STDDEV) using
> > similar technique ?
> > How about Firebird capabilities in this area ?
> >
> > Mario
> ------- End of Original Message -------