View source: R/stats-utility.R
geomMean | R Documentation |
The geometric mean is computed as:
\exp(\bar{log(x)})
, with:
log: natural logarithm
\bar{log(x)}
: arithmetic mean of log(x)
geomMean(x, na.rm = FALSE)
x |
Numeric vector. |
na.rm |
Logical, should NA value(s) be removed (FALSE by default)? |
Numeric vector of length 1 with geometric mean.
Laure Cougnaud
Other stats utility functions:
cv()
,
geomCV()
,
geomSD()
,
geomSE()
,
se()
# geometric mean of a big sample from log normal distribution
# tends to the mean of the distribution:
geomMean(rlnorm(n = 1000, meanlog = 0, sdlog = 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.