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: Marginal effects with outreg or estout using the new margins command
From
Danielle Li <[email protected]>
To
[email protected]
Subject
st: Marginal effects with outreg or estout using the new margins command
Date
Sat, 27 Jul 2013 11:33:52 -0400
Dear all,
I'd like to output marginal effects from a fixed effects regression.
I have tried 4 approaches involving the outreg2, estout, mfx, and
margins commands and none of them work (described below).
I would be really grateful if anyone has any ideas. Ideally, I'd to
report both the coefficients and the marginal effects in the same
output table, but I am also happy to just output the marginal effects
and coefficients into separate tables and combine later.
Thanks so much,
Danielle
1. Using margins with outreg2
areg y x [aweight=weight], cluster(is) absorb(is)
margins, eyex(x) atmeans
outreg2 x using filename, se nolabel bdec(3) rdec(3) nocons excel
replace margin
This command runs without error but when I look at my outreg file,
there are no coefficients reported (e.g. the space where the result is
is just blank)
2. Using mfx instead of margins
areg y x [aweight=weight], cluster(is) absorb(is)
mfx, eyex predict
outreg2 x using filename, se nolabel bdec(3) rdec(3) excel replace mfx
This fails because I get this error using mfx
mfx, eyex
default predict() is unsuitable for marginal-effect calculation
r(119)
Note: any predict option I explicitly try results in the same error.
3. Using estout with margins
eststo raw: areg y x [aweight=weight], cluster(is) absorb(is)
eststo mfx: margins, eyex(x) atmeans
estout raw mfx using filename, replace
This runs without error, but eststo raw and eststo mfx end up saving
the same output even though, when I run the margins, command, stata
successfully reports elasticities that are different from the
coefficients in the areg step. So I get two columns with the same
information.
4. All of the above with xtreg instead of areg. I get the same error
*
* 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/