Bookmark and Share

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


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

st: puzzling semi-elasticity from margins


From   "Dimitriy V. Masterov" <[email protected]>
To   Statalist <[email protected]>
Subject   st: puzzling semi-elasticity from margins
Date   Thu, 16 Jan 2014 11:01:16 -0800

I was under the impression that eydx corresponds to (dy/dx)*(1/y).
There's an example of on p. 1169 of the Stata 13 manual where for obs
5, dy/dx = 0.5, y = 15, and x = 30, so eydx is 0.0333333. My
assumption was that margins with this option would calculate the
average over all the observations. That does not seem to be the case
in this simple example:

sysuse auto
reg price mpg
margins, eydx(*)
gen double me = _b[mpg]*(1/price)
sum me
predict phat, xb
gen double me2 = _b[mpg]*(1/phat)
sum me2

margins, eydx gives  -.0421593.
sum me gives -.0451027
sum me2 yields -.0421593

The version where I divide by the predicted price rather than the
actual price for each observation seems to match the margins output.
What am I missing here?
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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