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

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

 From Maarten Buis To statalist@hsphsun2.harvard.edu 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, ///
*---------------- 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

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```