Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Dimitriy V. Masterov" <dvmaster@gmail.com> |
To | Statalist <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: puzzling semi-elasticity from margins |
Date | Thu, 16 Jan 2014 11:53:41 -0800 |
Austin, That makes perfect sense. Thanks once again! DVM On Thu, Jan 16, 2014 at 11:41 AM, Austin Nichols <austinnichols@gmail.com> wrote: > Dimitriy V. Masterov <dvmaster@gmail.com>: > You can't really assess dy/dx because your regression is not a model > of how y changes with x but how the conditional mean of y changes with > x. So you can assess > dE[y|x]/dx > assuming you have a good model of the conditional mean in your > regression. Then the semielasticity eydx would be > dE[y|x]/dx * (1/E[y|x]). > > Make sense? > > On Thu, Jan 16, 2014 at 2:01 PM, Dimitriy V. Masterov > <dvmaster@gmail.com> wrote: >> 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/ * * 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/