geomean: Geometric mean

View source: R/geomean.R

geomeanR Documentation

Geometric mean

Description

Returns the geometric mean of a vector of numbers, which is the nth root of their product.

Usage

geomean(x, na.rm = FALSE)

Arguments

x

Vector of numbers, required.

na.rm

Logical value, optional, FALSE by default. If FALSE, result is NA if any of the values in x is NA. If TRUE, remove the NA values first.

Details

The geomean is one type of average, used in working with lognormal distributions, for example. Is not as strongly influenced by extreme outliers as the arithmetic mean. See http://en.wikipedia.org/wiki/Geometric_mean for many applications.

Value

Returns a single number that is the geometric mean of the numbers in x.

See Also

harmean() mean() rms()

Examples

geomean(c(4,9)) # is the square root of 4 * 9

ejanalysis/analyze.stuff documentation built on April 2, 2024, 10:10 a.m.