gmean | R Documentation |
Computes the geometric mean of a numeric vector. It is the n-th root of the product of n numbers, as follows.
y_g = \left(\prod_{i=1}^{n} y_i\right)^{1/n}
for y_i > 0
.
The geometric mean can be used a central position statistics of
a random variable.
gmean(v)
v |
is a numeric vector |
Notice that can only be computed for positive values. For negative values, there are alternatives, but not covered here.
This function returns the geometric mean, a numeric scalar.
Christian Salas-Eljatib.
Salas-Eljatib, C. 2021. Análisis de datos con el programa estadístico R: una introducción aplicada. Ediciones Universidad Mayor, Santiago, Chile. 170 p. https://eljatib.com/rlibro
y.var <- runif(10, min=10, max=45)
gmean(y.var)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.