Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: Replicating -margins,eydx()- with interactions


From   Duha Altindag <daltin2@tigers.lsu.edu>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: Replicating -margins,eydx()- with interactions
Date   Fri, 3 Jun 2011 14:00:36 -0500

Dear Stata listers:

I am having trouble replicating semi-elasticity output of
-margins,eydx()- when I use interactions.

Below is my code:
****
webuse auto,clear
g log_mpg=ln(mpg)
reg price i.foreign##c.log_mpg
margins foreign,eydx(log_mpg) atmeans
su price
di "elasticity at foreign=0:  " _b[c.log_mpg]/r(mean)
di "elasticity at foreign=1:  " (_b[c.log_mpg]+_b[1.foreign#c.log_mpg])/r(mean)
****
I know eydx calculates (dydx)*(1/y).
I am thinking the dydx (coefficients) that -margins- use to calculate
eydx must be same as those I am using. Then, the difference can be
only due to the denominator.
Should I be using a different mean instead of r(mean)?

Thanks for your consideration.
--
Duha T. Altindag

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index