HARMEAN (matrix);
The HARMEAN function returns a scalar that contains the harmonic mean of the elements of the input matrix. The input matrix must contain only nonnegative numbers. The harmonic mean of a set of positive numbers is n 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 numbers. 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;