Announcement

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

  • Panel

    Hi guys,

    I'm fairly new to Stata and have a question regarding fixed effects. I tried finding the answer by reading other questions but I'm a bit confused as I have seen various different answers.

    For my thesis I want to run a baseline OLS regression for panel data. If I am not mistaken, this would be done by
    reg y x1 x2

    Now, I want to keep both industry and year fixed effects into account. Online I have seen various answers. Now I am confused when to use the ,fe option for xtreg and when to use the i.year or i.industry options.

    I first set my data to panel by using
    xtset gvkey year
    And now want to run a regression where industry (identified by SIC code) fixed effects and year fixed effects are taken into account. What should the code be for this?
    When I try the following codes
    xtreg y x1 x2 i.year, fe
    xtreg y x1 x2 i.year i.sic
    I get very different answers.

    Thanks in advance!
    Last edited by Ava Rooijakkers; 16 Jun 2021, 07:19.

  • #2
    Code:
    help xtreg
    will tell you that xtreg by default estimates a random effects model. You need the option -fe- to estimate a fixed effects model. Your data is at firm level (gvkey), so if you


    xtset gvkey year
    you get firm fixed effects if specifying the -fe- option. For what you want, either

    Code:
    xtset industry
    xtreg y x1 x2 i.year, fe robust
    or

    Code:
    regress y x1 x2 i.industry i.year, cluster(industry)
    regress y x1 x2 i.year, absorb(industry) cluster(industry)

    Comment


    • #3
      Thank you Andrew!

      I have another question, a different subject.

      In a paper by Bris, Koskinen, and Nilsso in 2009, they mention:
      "Observations with a negative EBITDA larger than total assets are removed"
      Could you please help me out with the code for this? I'm not sure how to specify the 'negative EBITDA' part.

      I tried googling, but didn't know exactly how to Google it either.

      Thanks in advance.

      Comment


      • #4
        The value of assets is strictly positive (unless they refer to net assets, in which case if liabilities> assets, then net assets are negative). Therefore, assuming that you have the earnings variable (EBITDA), then it should be something like:

        Code:
        gen todrop = ebitda<0 & abs(ebitda)> assets
        drop if todrop

        Comment

        Working...
        X