gm_mean: Geometric Mean

Description Usage Arguments Value Source Examples

View source: R/functions.R

Description

This is a function taken from the blog Stack Overflow that calculates the geometric mean of a set of numbers. Along with the h_mean and mean functions, they provide 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
gm_mean(x, na.rm = TRUE)

Arguments

x

The quantitative field from which to calculate the geometric mean.

Value

Returns a numeric which is the geometric 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: gm_mean(mtcars$mpg)

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