Announcement

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

  • Fixed effects with categorical variable

    Hello everyone,


    I am estimating the differences between migrants and natives in terms of access to welfare using a very simple linear probability model:

    reg welfare migrant controls, vce(custer id)

    where welfare is a dummy taking value one if an individual receives welfare. I have longitudinal data but cannot use fixed effects since migration status does not change over time.
    However in a second stage I estimate another equation substituting the dummy "migrant" for a vector of dummies capturing the number of years since arrival into the host country:

    reg i.ysa controls, vce(cluster id)

    where ysa is a variable that takes value zero for natives and values from 1 to 20 for migrants. Therefore "i.ysa" generates 20 dummies and leaves natives out as a reference category.
    My question is whether this second equation can be estimated using fixed effects, i.e.:

    xtreg i.ysa controls, fe vce(cluster)

    To my mind there should be a collinearity problem since there is no variation over time in the reference category. However, the code seems to work and I get estimates. Does anyone know the coefficients should be interpreted and why there is no collinearity problem? Any help is more than welcome

    Thanks in advance.




  • #2
    Eduard:
    why speculating on what's going on with your data when you can share what you typed and what Stata gave you back via CODE delimiters (as per FAQ)?
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Hello,

      Apologies Carlo, I am not very familiar with posting in the forum. Find my code below.

      Code:
       xtreg d_welfare i.ysa $controls, fe vce(cluster id)
      I am afraid I cannot share the output since I am working with confidencial data in a remote environment that does not allow sharing (I cannot copy-paste). The code yields the output you would normally expect from fixed effects estimation, but in this case I would expect a collinearity problem because of the reasons mentioned above.

      Best,
      Eduard

      Comment


      • #4
        Eduard:
        the -fe- machinery wipes out time-invariant variables.
        You can test via -xttab- if -i.ysa- varies within panel or not.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Thanks a lot Carlo. Indeed I realized there was some longitudinal variation that was not supposed to be there. Once I corrected that I got the collinearity problem I was expecting to have.

          Comment

          Working...
          X