Interesting idea, Andrew. I don't know how to do what you're asking for, but I'd be interested to see it added too. I'd never heard of geometric means, but I can already think of several areas where they might be useful. Thanks for sharing the information on how they're calculated!
Matthew Walker Senior Software Engineer ePliant Marketing -----Original Message----- From: Andrew Gould [mailto:[EMAIL PROTECTED]] Sent: Saturday, May 11, 2002 6:51 AM To: [EMAIL PROTECTED] Subject: geometric mean aggregate function Has anyone out there developed a costum, aggregate function for calculating the geometric mean of populations? If not, would anyone be interested in creating one? My development experience/skills is limited to SQL and simple Python scripts; so I had difficulty understanding the documentation on creating functions. Why _you_ might want this function: Geometric mean is a good replacement for arithmetic mean when you want to reduce the effects of extreme, infrequent values without excluding the occurrences altogether. An example is Medicare's (US government health insurance for the elderly) use of geometric mean to derive standard lengths of stay (days in the hospital) for patients within Diagnostic Related Groups (DRGs). For companies calculating statistics for internal process improvement projects, this function would be very useful because is describes what usually happens better than the arithmetic mean (see below). Calculating geometric mean: Geometric mean is calculated by multiplying the values of each occurrence together and raising the resulting product by the power of 1 divided by the sample size. Therefore, the geometric mean of 2 3, 4, 5, and 40 would be (2*3*4*5*40)^(1/5) = 5.448139855, which is very different from the arithmetic mean of 10.8. I certainly would have liked my school grades to be calculated this way! If anyone has created this function and would be willing to share it, I would greatly appreciate it. If the developers on this list see value in adding it as a standard function to MySQL, I think you will be ahead of the pack as industries are becoming more data savvy. Is this a fairly simple request; or would it have been more appropriate to send this request to [EMAIL PROTECTED]? Thanks, Andrew Gould __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php