Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: geometric means

From   Roger Newson <[email protected]>
To   [email protected]
Subject   Re: st: geometric means
Date   Wed, 04 May 2005 15:36:28 +0100

At 14:15 04/05/2005, Mariarosaria wrote:

dear all,
is there a way to obtain geometric means when using the following command:

 egen mean_x=mean(x), by(time)
Yes. You should type:

gene logx=log(x)
egen mean_logx=mean(logx), by(time)
gene gmean_x=exp(mean_logx)

If you want to calculate confidence intervals for geometric means and their ratios, then you can use the -eform()- option of -regress-. To find out about that, download my Stata Tip on this subject, which you can find from within Stata by typing

findit gmratio

which will direct you to a .pdf preprint.

Hope this helps.


Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
Division of Asthma, Allergy and Lung Biology
King's College London

5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: [email protected]

Opinions expressed are those of the author, not the institution.

* For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index