describe(deprecated)/harmonicmean - Help

Home : Support : Online Help : describe(deprecated)/harmonicmean

stats[describe, harmonicmean]

Harmonic mean of a statistical list

 Calling Sequence stats[describe, harmonicmean](data) describe[harmonicmean](data)

Parameters

 data - statistical list

Description

 • Important: The stats package has been deprecated. Use the superseding package Statistics instead.
 • The function harmonicmean of the subpackage stats[describe, ...] computes the harmonic mean of the given data.
 • Classes are assumed to be represented by the class mark, for example 10..12 has the value 11. Missing data are ignored.
 • The harmonic mean is defined to be the reciprocal of the mean of the reciprocals of the data. A mnemonic formula is $\frac{1}{H}=\frac{\sum \phantom{\rule[-0.0ex]{5.0px}{0.0ex}}\frac{1}{X}}{N}$.
 • The harmonic mean  is a measure of central tendency. For more information about such measures, refer to the information for the (arithmetic) mean. The harmonic mean is often appropriate when one is dealing with velocities or rates.
 • The command with(stats[describe],harmonicmean) allows the use of the abbreviated form of this command.

Examples

Important: The stats package has been deprecated. Use the superseding package Statistics instead.

 > $\mathrm{with}\left(\mathrm{stats}\right):$

The harmonic mean of 1/3 and 1/5 is

 > $\mathrm{describe}[\mathrm{harmonicmean}]\left(\left[\frac{1}{3},\frac{1}{5}\right]\right)$
 $\frac{{1}}{{4}}$ (1)

When I purchase gasoline for my automobile, I always pay 1 Sim. Of course the price is never the same. One time it was 3 Sim/bucket, at another time it was 5 Sim/bucket. The average price'' is then obtained as follows: The first time I obtained 1/3 buckets. The second time, it was 1/5 buckets. In total I obtained 1/3+1/5 buckets for a cost of 2 Sim. The average price I paid was then 2/ (1/3+1/5)=15/4=3.75 Sim/bucket.

 > $\mathrm{describe}[\mathrm{harmonicmean}]\left(\left[3,5\right]\right)=\frac{2}{\frac{1}{3}+\frac{1}{5}}$
 $\frac{{15}}{{4}}{=}\frac{{15}}{{4}}$ (2)

Note that the arithmetic mean is not appropriate in this case, since it is equal to

 > $\mathrm{describe}[\mathrm{mean}]\left(\left[3,5\right]\right)\ne \frac{15}{4}$
 ${4}{\ne }\frac{{15}}{{4}}$ (3)

If the first time, since the price was low, I bought for 2 Sim of fuel, the average price becomes

 > $\mathrm{describe}[\mathrm{harmonicmean}]\left(\left[\mathrm{Weight}\left(3,2\right),5\right]\right)=\frac{3}{\frac{2}{3}+\frac{1}{5}}$
 $\frac{{45}}{{13}}{=}\frac{{45}}{{13}}$ (4)