Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Log transformation

From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: Log transformation
Date   Tue, 16 Aug 2011 12:42:11 +0200

On Tue, Aug 16, 2011 at 12:18 PM, Amy Jennings wrote:
>can I just check that I have substituted the glm command in the right way below? The adjusted means I am getting from the glm model seem different to what I would expect.
> xi:reg log_ins i.q5_adj age smoke bmi
> adjust age smoke bmi, by (q5_adj) se ci
> xi:glm ins i.q5_adj age smoke bmi, link(log)
> adjust age smoke bmi, by (q5_adj) se ci

A better way of asking this is to also mention what you expected and
how the Stata output is different from that. Now we just have to

The key part in the output is at the bottom " Key:  Linear
Prediction", so you are not getting the predicted ins (whatever that
may be) but the linear predictor. In both cases you need to add the
-exp- option (and remove the -se- option). The difference is that with
regress you will get in this case the adjusted geometric means (*),
while with -glm- you will get the adjusted arithmetic ("normal")

Hope this helps,

(*) This is not true in general, but just a feature of first computing
the logarithm, compute the mean, and than back-transform the mean
again. See Roger Newson (2003) "Stata tip 1: The eform() option of
regress". The Stata Journal, 3(4): 445.

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index