mean_geom | R Documentation |
Calculates the geometric mean of a vector, returning a single value. The geometric mean,
like the mean and the median, is an indication of the central tendancy of a set of numbers.
The geometric mean is the nth root of the product of n numbers. For instance,
the geometric mean of 2 and 8 is sqrt(2 * 8) = 4
.
The geometric mean is useful when computing the central tendency of measures that have different
ranges. For instance, when computing a single "figure of merit" from differentrating scales that
have ranges 0 to 5 and 0 to 100.
mean_geom(x, na.rm = TRUE)
x |
A numeric or integer vector |
na.rm |
a boolean indicating, if |
The geometric mean is only defined for positive numbers, and mean_geom
first removes
any negative numbers.
For speed, mean_geom
computes the log of each term, sums the logs, then computes the
exponent of the sum.
The geometric mean of the vector x
, or NULL
with a warning
if the geometric mean cannot be calculated
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.