Returns the geometric mean, using zero fuzzing
Category: Descriptive Statistics
GEOMEANZ ( argument <, argument , >)
argument
is a non-negative numeric constant, variable, or expression.
Tip: The argument list can consist of a variable list, which is preceded by OF.
The MEAN function returns the arithmetic mean (average), and the HARMEAN function returns the harmonic mean, whereas the GEOMEANZ function returns the geometric mean of the non-missing values. Unlike GEOMEAN , GEOMEANZ does not fuzz the values of the arguments that are approximately zero.
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 non-missing values.
Let n be the number of arguments with non-missing values, and let x 1 , x 2 , ___, x n be the values of those arguments. The geometric mean is the n th root of the product of the values:
Equivalently, the geometric mean is
SAS Statements | Results |
---|---|
x1=geomeanz(1,2,2,4); | 2 |
x2=geomeanz(.,2,4,8); | 4 |
x3=geomeanz(of x1-x2); | 2.8284271247 |
Function:
'GEOMEAN Function' on page 567
'HARMEAN Function' on page 574
'HARMEANZ Function' on page 575
'MEAN Function' on page 644