Statalist


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

RE: st: how to get marginal effect when dependent variable has ln function?


From   Maarten buis <[email protected]>
To   stata list <[email protected]>
Subject   RE: st: how to get marginal effect when dependent variable has ln function?
Date   Wed, 24 Jun 2009 08:42:03 +0000 (GMT)

--- On Wed, 24/6/09, Garry Anderson wrote:
> Below you mention
> "while -glm- will give the percentage change in the
> arithmatic mean of y for a unit change in x. "
> 
> I was wondering if you could give an example please 
> of the -glm- command that would give the percentage
> change in the arithmatic mean of y for a unit change 
> in x.

So building on Roger's example in (Newson 2003), you
can see that the geometric mean price of a domestic
car is 5533 dollars while the arthmatic mean is 
6072 dollars. The geometric mean of foreign cars
is 7.7% larger than domestic cars while the arithmatic 
mean of foreign cars is 5.1% larger. 

*--------- begin example ----------
sysuse auto, clear
generate logprice = log(price)
generate byte baseline = 1
regress logprice foreign ,      ///
   eform(GM/Ratio) robust
est store geometric

glm price foreign ,             ///
   eform robust link(log)
est store arithmatic

est table geometric arithmatic, ///
    eform eq(1) 
*---------- end example -----------

Hope this helps,
Maarten

Roger Newson (2003) Stata tip 1: The eform() option 
of regress. The Stata Journal, 3(4): 445.
http://www.stata-journal.com/article.html?article=st0054

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

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      

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



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