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: Re: margins
Christopher Baum <firstname.lastname@example.org>
Alessandro Oliveira <email@example.com>
st: Re: margins
Wed, 29 Aug 2012 14:37:50 +0000
The old mfx command works as always, but it generates marginal effects at the mean rather than average marginal effects (AMEs). The latter are generally preferred.
If you use the post option on margins, it wipes out the ereturns, so anything from the regression ereturns are now inaccessible. The following logic can be used to combine information from the regress ereturns and the margins ereturns, using the -estadd- component of Ben Jann's -estout- package from SSC:
reg price mpg weight turn
sca r2_a = e(r2_a)
sca rmse = e(rmse)
margins, eyex(_all) post
estadd sca r2adj = r2_a
estadd sca rmse = rmse
esttab, stat(N r2adj rmse)
Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html
An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html
On Aug 29, 2012, at 10:22 AM, Alessandro Oliveira wrote:
> Hi Chris,
> I have doubts on the "margins" command of Stata.
> 1) Does the old mfx command generate bad results in Stata 12?
> 2) After a regression, using:
> margins, eyex(_all) post
> does not return the adjusted R2. Do you have any hint on how to accomplish that?
* For searches and help try: