Returns the geometric mean.

Category: | Descriptive Statistics |

If any argument is negative,
then the result is a missing value. A message appears in the log that
the negative argument is invalid, and _ERROR_ is set to 1. If any
argument is zero, then the geometric mean is zero. If all the arguments
are missing values, then the result is a missing value. Otherwise,
the result is the geometric mean of the nonmissing values.

Let
$n$ be the number of arguments with nonmissing values,
and let
${x}_{1},{x}_{2},\dots ,{x}_{n}$ be the values of those arguments. The geometric
mean is the
${n}^{th}$ root of the product of the values:

$\begin{array}{c}\mathrm{exp}\left(\frac{(\mathrm{log}\left({x}_{1}\right)+\mathrm{log}\left({x}_{2}\right)+\dots +\mathrm{log}\left({x}_{n}\right))}{n}\right)\phantom{\rule{0.265em}{0ex}}\hfill \end{array}$

Floating-point arithmetic
often produces tiny numerical errors. Some computations that result
in zero when exact arithmetic is used might result in a tiny nonzero
value when floating-point arithmetic is used. Therefore, GEOMEAN fuzzes
the values of arguments that are approximately zero. When the value
of one argument is extremely small relative to the largest argument,
then the former argument is treated as zero. If you do not want SAS
to fuzz the extremely small values, then use the GEOMEANZ function.

Copyright © SAS Institute Inc. All rights reserved.