hmean | R Documentation |
Computes the harmonic mean of a numeric vector. It is the inverse of the mean of the recriprocals of n numbers, as follows.
y_h = \frac{n}{\left(\sum_{i=1}^{n} \frac{1}{y_i}\right)}
for y_i \neq 0
.
The harmonic mean can be used a central position statistics
of a random variable.
hmean(v)
v |
is a numeric vector |
Notice that can only be computed for values different from cero.
This function returns the harmonic 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)
hmean(y.var)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.