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 on continuous interactions.


From   Alfonso Sánchez-Peñalver <[email protected]>
To   Stata List <[email protected]>
Subject   Re: st: margins on continuous interactions.
Date   Mon, 9 Dec 2013 10:09:39 -0500

Hi Natasha,

my question was related to why you don’t include the actual variables of x3 and x4 but only the interaction. when x3 changes it will affect the probability by itself (unless the coefficient on x3 is insignificant) and because of its interaction with x4. If the coefficient of x3 (on itself) is not insignificant you are omitting a relevant variable and your estimates of the coefficients will be biased. The estimate of the marginal effect of x3 would also be wrong, because in reality it would be b3 (the marginal effect of x3) + b34 0.15 (where b34 is the marginal effect of the interaction variable). Margins is able to automatically incorporate both if you enter x3##x4 (or x3 x3#x4 if you want to leave x4 out for some reason) into your -xtreg- command. I also have a question of why do you expect the standard errors returned by margins when calculating the marginal effects (dydx) to be any different from those returned from -xtreg-. In -xtreg- the marginal effects on the response!
  variable are already the estimated coefficients, and thus the standard errors returned by -xtreg- are the appropriate ones. That is why I said that there would be no variation.

Best,

Alfonso.

On Dec 9, 2013, at 12:14 AM, Natasha Agarwal <[email protected]> wrote:

> Dear Alfonso,
> 
> So x4 in my case represents 27 industries, and each industry has a
> value. For instance, x4 for industry one is 0.15, but for industry 2
> is 0.20. The reason I want to use margins so that I am able to get the
> p-values and the confidence intervals for x3 for each value of x4.
> Besides, I want to plot a marginsplot for the same.
> 
> Can someone tell me if the scaling is an issue in using the margins
> command in my case, and whether to use noestimchek option is correct ?
> 
> Best,
> Natasha
> 
> On Fri, Dec 6, 2013 at 5:43 PM, Alfonso Sanchez-Penalver
> <[email protected]> wrote:
>> Hi Natasha,
>> 
>> On a different note to what Jeff suggested you are only introducing the interaction term between x3 and x4, not the actual levels of the variables. You then want to know the marginal effect of x3 at x4=0.15. That is simply the coefficient on the interaction term times 0.15. There is no variation. So what are you expecting margins to do?
>> 
>> Best,
>> 
>> Alfonso Sanchez-Penalver
>> 
>>> On Dec 6, 2013, at 12:33 AM, Natasha Agarwal <[email protected]> wrote:
>>> 
>>> Dear Jeff,
>>> 
>>> Thank you for your help.
>>> 
>>> The codes are as follows
>>> 
>>> ******
>>> xtset firm year
>>> xtreg y x1 x2 c.x3#c.x4 i.year, fe vce(robust)
>>> margins, dydx(x3) at(x4=0.15)
>>> 
>>> *****
>>> 
>>> In the above codes: y = varies at firm and time, x1 = varies at firm
>>> and time, x2 = varies at firm and time, x3 = varies at industry region
>>> and time, x4 = varies at industry only.
>>> 
>>> I looked at the advised archives Statalist option, and I went ahead
>>> with it. However, I am not sure if noestimcheck is the right option?
>>> Can you please explain me if possible on how would one know when to
>>> use the noestimcheck option?
>>> 
>>> Thank you very much again and sorry for taking your time.
>>> 
>>> Best,
>>> Natasha
>>> 
>>> 
>>> On Thu, Dec 5, 2013 at 10:53 PM, Jeff Pitblado, StataCorp LP
>>> <[email protected]> wrote:
>>>> Natasha Agarwal <[email protected]> is using -margins- after -xtreg, fe- but
>>>> is getting (not estimable) for the requested marginal effect:
>>>> 
>>>>> I estimate a fixed effect model xtreg y x1 x2 x3*x4 year dummies, fe
>>>>> vce(robust)
>>>>> 
>>>>> where y, x1, x2, are firm level variables. x3 changes over
>>>>> industry-region-year. while x4 changes only over industry. After this, I
>>>>> estimate margins, dydx(x3) at(x4 = 0.15). I get a not estimable error. I
>>>>> then try to use the noestimcheck option, and state margins, dydx(x3)
>>>>> at(x=0.15) noestimcheck. and I get an output. However I am not sure whether
>>>>> it is correct to use the noestimcheck option here.
>>>> 
>>>> Natasha identifies several grouping variables (firm, industry, region, year)
>>>> but does not indicate which grouping variable was -xtset- as the panel
>>>> variable so it is very difficult to reproduce the problem.
>>>> 
>>>> Even if we cannot have access to Natasha's data, showing us all the relevant
>>>> Stata code would have been more helpful.  Something like
>>>> 
>>>>> The code I used was
>>>>> 
>>>>> ***** BEGIN:
>>>>> xtset ???panelvariable???
>>>>> xtreg y x1 x2 c.x3#c.x4 i.year, fe vce(robust)
>>>>> margins, dydx(x3) at(x4=0.15)
>>>>> ***** END:
>>>> 
>>>> I suspect Natasha is experiencing scaling problems.  -margins- can have a
>>>> difficult time in checking for estimable functions when crossed continuous
>>>> variables are on very different scales.
>>>> 
>>>> If my suspicions are correct, then I imagine the advice at the end of the
>>>> following post is relevant for Natasha as well.
>>>> 
>>>>       http://www.stata.com/statalist/archive/2011-07/msg00514.html
>>>> 
>>>> --Jeff
>>>> [email protected]
>>>> *
>>>> *   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/
> 
> *
> *   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