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]

Re: st: Marginal effects with outreg or estout using the new margins command


From   Danielle Li <[email protected]>
To   [email protected]
Subject   Re: st: Marginal effects with outreg or estout using the new margins command
Date   Sat, 27 Jul 2013 12:08:22 -0400

Yes, that works perfectly. Federico, thank you!

Quick followup--is there a way to get it to output both the
coefficient estimates and the marginal effects to be below one
another?  e.g.

                             (1)
Main coeff 1          1.3
                           (0.5)
Elasticity  1            0.6
                           (.03)

Main coeff 2          1.7
                           (0.8)
Elasticity  2            0.4
                           (.02)

Thanks again,
Danielle


On Sat, Jul 27, 2013 at 11:46 AM, Federico Belotti <[email protected]> wrote:
> Danielle
> try to add the option -post- to the -margin- command...
>
> Federico
>
> Il giorno 27/lug/2013, alle ore 17:33, Danielle Li <[email protected]> ha scritto:
>
>> 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/
>
> *
> *   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/


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