Date: Fri, 4 Sep 2009 19:21:08 -0400
Reply-To: "Kirby, Ted" <ted.kirby@LEWIN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Kirby, Ted" <ted.kirby@LEWIN.COM>
Subject: Geometric mean of observatons by category
Content-Type: text/plain; charset="us-ascii"
I would like to get the geometric mean of values by category. What
would be ideal would be if PROC MEANS had a Geometric Mean option
analogous the MEAN SUM or other statistical calculation. However, I
could find no indication of this capability of PROC MEANS in the
I can calculate the geometric mean by sorting the dataset and then
process the data in a SAS data step using the "FIRST.var" and "LAST.var"
operations. However, I was wondering if it was possible to get it using
the GEOMEAN function.
input category number;
For this dataset I would an output that looks like this.
Category Geometric Mean of Number
I feel like I am missing some really obvious or simple methodology, but
I just can't think of anything at the moment.
My real data set has 13 million observations and 500+ categories. Thus,
I would like the code to be as efficient as possible (i.e., not take
hours to run, if possible).
I have SAS 9.1.3 on Windows XP professional.
************* IMPORTANT - PLEASE READ ********************
This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately.