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

Re: st: transformation of continuos variable

 From Maarten buis To statalist@hsphsun2.harvard.edu Subject Re: st: transformation of continuos variable Date Wed, 14 Apr 2010 07:54:03 +0000 (GMT)

```--- On Tue, 13/4/10, riyadh shamsan wrote:
> I am using STATA 10. I did a linear regression on log transformed
> variable. To present the result i anti-logged the results but now the
> confidence interval is a bit confusing as it doesn't cross 0

By anti-logging your predictions you did not create predictions on
the original unit but conditional geometric means, which is probably
not what you want. The reason is that you moddeled how the
log-transformed dependent variable changes when your independent
variables change, while you probably wanted to model how the dependent
variable changes (in a possible non-linear way) when the independent
variables change. There are ways of correcting the predictions, but
the better way is to avoid the problem by estimating the right model
from the start by using -glm- in combination with the -link(log)-
option. See for example:

Nicholas J. Cox, Jeff Warburton, Alona Armstrong, Victoria J. Holliday
(2007) "Fitting concentration and load rating curves with generalized
linear models" Earth Surface Processes and Landforms, 33(1):25--39.
<http://www3.interscience.wiley.com/journal/114281617/abstract>

So to give a concrete example. In the example below you can see that
someone who is white, with no education, no experience, and without
union membership can expect an hourly wage of 1.66 dollars (the
baseline). Union membership lead to an increase of wage by a factor
of 1.10 (that is, 10%), a year extra education leads to an increase
in wage by a factor of 1.08 (i.e. 8%) and begin black leads to a
change in wage by a factor of .91 (i.e. -9%).

In order to create predictions in Stata 10 while keeping some of the
covariates constant, it is convenient to use the -adjust- command. So
in the example below the graph shows how the expected wage for white
union members with average work experience, change over education.

*-------------- begin example ---------------
sysuse nlsw88, clear
gen byte baseline = 1
gen byte black = race == 2 if race != .
glm wage grade union ttl_exp black baseline, ///

preserve

twoway rarea lb ub grade ||          ///
ytitle(predicted hourly wage)
restore

*------------- end example -------------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )

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/
```