h_mean: Harmonic Mean

Description Usage Arguments Value Source Examples

View source: R/functions.R

Description

This is a function taken from the blog Statistics on aiR that calculates the harmonic mean of a set of numbers. Along with the gm_mean and mean it provides the three most basic functions of "average." Typically, the arithmetic mean should be used for linear relationships, the geometric mean should be used for exponential or multiplicative relationships, and the harmonic mean should be used for reciprocal relationships.

Usage

1
h_mean(x)

Arguments

x

The quantitative field from which to calculate the harmonic mean.

Value

Returns a numeric which is the harmonic mean

Source

592862722639. <e2><80><9c>On Average, You're Using the Wrong Average: Geometric & Harmonic Means in Data Analysis.<e2><80><9d> Towards Data Science, Towards Data Science, 28 Jan. 2018, towardsdatascience.com/on-average-youre-using-the-wrong-average-geometric-harmonic-means-in-data-analysis-2a703e21ea0.

Examples

1
## Not run: h_mean(mtcars$mpg)

jsdeherrera/shinyStats documentation built on May 13, 2019, 11:54 p.m.