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: Margins for interactions terms


From   emanuele mazzini <madsoenistata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Margins for interactions terms
Date   Tue, 10 Dec 2013 10:20:01 +0100

Thank you for your advices, and sorry for the misunderstanding.

Emanuele.

2013/12/9 Nick Cox <njcoxstata@gmail.com>:
> Good advice. It's a fair guess that this program needs more than minor
> surgery to perform with -margins-.
> Nick
> njcoxstata@gmail.com
>
>
> On 9 December 2013 21:19, Richard Williams
> <richardwilliams.ndu@gmail.com> wrote:
>> At 02:43 PM 12/9/2013, Nick Cox wrote:
>>>
>>> You asked a similar question before.
>>>
>>> http://www.stata.com/statalist/archive/2013-12/msg00300.html
>>>
>>> -reg2hdfe- is a user-written program from SSC, as you are asked to
>>> explain. Evidently the author is not an active member of Statalist;
>>> many users, naturally, are not.
>>>
>>> Adding code to return e(sample) is documented at -help ereturn-. You
>>> would need to clone the program, find the appropriate place to add
>>> code and take responsibility for what happens. Alternatively, try
>>> emailing the author directly.
>>
>>
>> Without even looking at the code I bet it is even more complicated than
>> that. The program was written for Stata 9.1 which is pre-factor variable
>> notation. So, my guess is that margins is not going to handle the
>> interaction term correctly.
>>
>>
>>
>>> Nick
>>> njcoxstata@gmail.com
>>>
>>>
>>> On 9 December 2013 16:45, emanuele mazzini <madsoenistata@gmail.com>
>>> wrote:
>>> > Dear all,
>>> >
>>> > I am estimating a gravity model with exporter-year and importer-year
>>> > FE with an interaction term  and the reg2hdfe command, as follows:
>>> >
>>> >
>>> > reg2hdfe ln(trade_flow) ln(gdp_o) ln(gdp_d) ln(distance) x1 x2 x1*x2,
>>> > id1(it) id2(it)
>>> >
>>> > where it and jt are defined as:
>>> >
>>> > egen it = group (iso_o year)
>>> > egen jt = group (iso_d year)
>>> >
>>> > After I obtain the estimation results, I try to run the margins
>>> > command as to obtain the marginal effect of x1 on the dependent
>>> > variable lx and draw a marginsplot.
>>> >
>>> > Unfortunately, when I run -margins- Stata returns me the following
>>> > error:
>>> >
>>> > e(sample) does not identify the estimation sample.
>>> >
>>> > which seems a bit strange to me, because -ereturn list- gives me the
>>> > e(N)
>>> > function.
>>> >
>>> > Anyone knows how to add the e(sample) to the list of functions that
>>> > -reg2hdfe- returns?
>>> >
>>> > Thank you in advance,
>>> >
>>> > Regards,
>>> >
>>> > Emanuele.
>>> > *
>>> > *   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/
>>
>>
>> -------------------------------------------
>> Richard Williams, Notre Dame Dept of Sociology
>> OFFICE: (574)631-6668, (574)631-6463
>> HOME:   (574)289-5227
>> EMAIL:  Richard.A.Williams.5@ND.Edu
>> WWW:    http://www.nd.edu/~rwilliam
>>
>>
>> *
>> *   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