Description Usage Arguments Details Value References See Also Examples

This function computes the sample geometric mean.

1 |

`x` |
numeric vector that contains the sample data points (any negative values will be ignored). |

`na.rm` |
logical vector that determines whether the missing values should be removed or not. |

Geometric mean is expressed as

*\bar{x}_g = ≤ft(x_{1}x_{2} \cdots x_{n}\right)^{\frac{1}{n}}*

*\bar{x}_g*the sample geometric mean

*x*the values in a sample

*n*the number of positive values

"The geometric mean is used in averaging values that represent a rate of change. It is the positive nth root of the product of the n values."

sample geometric mean as a numeric vector. The default choice is
that any NA values will be kept (`na.rm = FALSE`

). This can be
changed by specifying `na.rm = TRUE`

, such as `sgm(x, na.rm = TRUE)`

.

Nathabandu T. Kottegoda and Renzo Rosso, *Statistics, Probability, and Reliability for Civil and Environmental Engineers*, New York City, New York: The McGraw-Hill Companies, Inc., 1997, page 13.

`mean`

for arithmetic mean

`shm`

for harmonic mean, `cv`

for coefficient of
variation (CV), `relerror`

for relative error, `approxerror`

for
approximate error, `rms`

for root-mean-square (RMS), and `ranges`

for sample range.

1 2 3 4 5 6 7 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.