Resources

Geometric mean

0

How do I find the geometric mean? I do not know the code. Thank you for help!

Tags: asked December 31, 2012

2 Answers

0
accepted

For a given x, you can calculate the geometric mean with the following code in GAUSS:


>> x = { 5, 20, 40, 80, 100 };
>> g_mu = exp(sumc(ln(x)/rows(x)));
>> g_mu
    31.697864

0

You can simplify it slightly to this:

g_mu = exp(meanc(ln(x)));