Language Reference |

**calculates harmonic means**

**HARMEAN(***matrix***)**

where *matrix* is a numeric matrix of nonnegative values.

The HARMEAN function returns a scalar containing the harmonic mean of the elements of the input matrix. The harmonic mean of a set of positive numbers is divided by the sum of the reciprocals of . That is, .

The harmonic mean is zero if any of the are zero. The harmonic mean is not defined for negative inputs. If any of the are missing, they are excluded from the computation.

The harmonic mean is sometimes used to compute an average sample size in an unbalanced experimental design. For example, the following statements compute an average sample size for five samples:

sizes = { 8, 12, 23, 10, 8 }; /* sample sizes */ aveSize = harmean( sizes ); print aveSize; aveSize 10.486322

Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.