Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

Re: st: RE: retransformation of ln(Y) coefficient and CI in regression

From   Maarten Buis <>
Subject   Re: st: RE: retransformation of ln(Y) coefficient and CI in regression
Date   Mon, 6 Jun 2011 09:01:44 +0200

On Sun, Jun 5, 2011 at 6:55 PM, Steve Rothenberg wrote:
> . glm Y i.factor, vce(robust) family(Gaussian) link(log)
> followed by
> . predict xxx, mu
> the command does indeed return the factor predictions in the original Y
> metric.
> However, the regression table with 95% CI is still in the original ln(Y)
> units and I am still stuck not being able to calculate the 95% CI in the
> original Y unit metric.

As for the regression table, you can your coefficients in the y metric
by specifying the -eform- option:

*-------------- begin example -----------------
sysuse auto, clear
gen byte baseline = 1
gen c_mpg = mpg - 20
glm price c_mpg foreign baseline, ///
    link(log) nocons eform
*---------------- end example ----------------

In this example the domestic cars with 20 miles per gallon cost on
average 5,735 dollars. This price increases by a factor 1.36, i.e.
36%, when the car is foreign and decreases by a factor .93, i.e. -7%,
for every mile per gallon increase in mileage.

> The predict command for returning prediction SE
> (stdp) also only returns the SE in the ln(Y) metric.
> I'd welcome further suggestions for deriving the 95% confidence interval in
> the original Y metric after either

For that type of problem I like the old -adjust- command, see: -help
adjust-. That help file says that it is superseded by the -margins-
command, but it is much easier to use if you want to create variables
(e.g. as preparation for creating graphs).

Hope this helps,

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

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index