Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Geometric mean in log base 10

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-07-2012 03:33 AM

I need to calculate the geometric mean of data.

These data are first **transformed in log10**.

Then I do the arithmetic mean of these log10 values and then i do the exponential of the arithmetic mean.

Do you confirm I am right?

(I find very different values from arithmetic mean so I am not sure I do the calculation correclty).

Moreover, someome told me that I should do GM = exponential of the arithmetic mean * log(10) (log function is the natural logarithm in SAS) and not just GM = exponential of the arithmetic mean

Thanks.for your help

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-07-2012 07:30 AM

The backtransformation is not exp(), but rather 10**(), when the transformation is log10. The expression log(10)*exp() will give the same value.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-08-2012 04:56 AM

Dear Steve,

Thanks for your reply.

Just to clarify, if I do 10**(mean_of_log_values), it is not equal to log(10)*exp(mean_of_log_values).

I found the same result if I do exp(mean_of_log_values * log(10).

So, what is the good formula?

Thanks.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-08-2012 05:48 AM

My mistake.

Let X = mean of log10 values.

Then geometric mean = 10**X

OR geometric mean = exp(log(10)*X), where log is the natural log of 10 = 2.303 (approximately).

If the variables in question are x1 to xN, then Ksharps recommendation of geomean(x1, x2,..., xN) is the way to go. Note that this is invalid for any x less than zero, and returns zero if any of the x's are equal to zero. This may require transposing the data if the x values are on separate records.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-07-2012 09:52 PM

SAS has a function GEOMEAN() to do this way . Do you need it ?