Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sign changes when include fixed effects

    Dear all,
    I hope all is well,
    Please, I am running a Pooled logistic regression model (panel data ),my Id variable is Company ID. Well, previous literature related to my topic suggest that we should not add company fixed effect and we should to include Country and Year fixed effects with clustering standard error at company ID. However, there are two main variables (no control variables) when I include the country fixed effects the sign moved form negative to positive though I did not remove any variable form previous regression. Meanwhile, I have checked in this site to know the reason, I have seen that the variable doesn't vary much over time something like that , but I could not understand it very well. In this case, I hope if someone could help me for both ( the reason behind that and how can I solved and justify it ). well , if the reason is what I understand that the variable doesn't vary much over time . please, How can I check this in stata ? Thank you so much .
    Dear Clyde Schechter, I would like to hear from you if this situation consider under your specialization. Many Thanks.

  • #2
    When you have panel data, a predictor variable can have an effect on the outcome by virtue of differences across panels, or by virtue of differences within a panel. Those effects do not have to be the same. Run the following code for a demonstration of how these effects can differ, and even be opposite in direction:

    Code:
    clear
    set obs 5
    gen panel_id = _n
    expand 2
    
    set seed 1234
    by panel_id , sort: gen y = 4*panel_id - _n + 3 + rnormal(0, 0.5)
    by panel_id: gen x = panel_id + _n
    
    xtset panel_id
    
    xtreg y x, fe
    regress y x
    
    //    GRAPH THE DATA TO SHOW WHAT'S HAPPENING
    separate y, by(panel_id)
    
    graph twoway connect y? x || lfit y x
    Pay particular attention to the graph which shows how, across panels, y increase with x, but within panels it decreases with x.

    When you add the country fixed effect to your model, that has the effect of changing the estimates of other variables from being a mixture of the between-panel and within-panel effect to being pure estimates of the within-panel effect.

    This phenomenon is one particular example of what is more generally referred to as Simpson's paradox (or, as here in the context of a regression, Lord's paradox). The Wikipedia page on Simpson's paradox is particularly good, and I recommend it for a deeper understanding.

    Added: It is usually not a good idea to address your question to a particular Forum member. As it happens, I came on to the Forum shortly after you posted this and saw it. But had I not, other people who might be very able and willing to respond to your question might have been discouraged from doing so, which would have delayed your getting a response, and perhaps led to your not getting one at all (if I never saw it.)
    Last edited by Clyde Schechter; 22 Mar 2021, 15:16.

    Comment


    • #3
      Dear Clyde Schechter.


      First of all, Many Thanks for you response as well as your final note ( It is usually not a good idea to address your question to a particular Forum member). I will take this into my account in the future( I am Sorry) . Thank you .

      Well, I understand what you have mentioned about the Code (I will ) and the effect of changing the estimates . Now, I am going to the Wikipedia page on Simpson's paradox . Thank you so much for your answer and your suggestion for the page.

      Comment

      Working...
      X