Announcement

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

  • How to implement subsidary fixed effects in Stata

    Dear all,

    for my master thesis I am currently working with firm balance sheet data. I would like to explore the impact of taxes on firms debt ratio. I have a large dataset with firms and their subsidaries. For my analysis; I would like to focus on the subsidaries and run a fixed effects regression. I would like to implement subsidary and year fixed effects. For the subsidaries, the data gives a unique ID number for each subsidary. I implemented the fixed effects on that ID number using the xtset command:

    egen sub_id = group(BVDID_SUB) // the id variable is a string, so I converted it into numeric

    xtset sub_id year1 // I place fixed effects on the subsidaries and on the years

    drop if sub_id==. // I drop missing values

    xtreg Y x1 x2 x3, fe // then I run my fixed effects regression

    Is it correct to place fixed effects on the id variable or are there other ways to implement them for subsidaries?

    Thank you in advance
    Last edited by Enzo Beni; 29 May 2022, 04:03.

  • #2
    Enzo:
    welcome to this forum.
    1) your -egen- and -xtset- command are correct;
    2) -drop- can be skipped altogether, as Stata applies listwise deletion (ie, all the observations with at leat one missing value don't pass muster and are ruled out from the subsequent statistical procedure);
    3) depending on the number of your N, you may want to consider non-default standard errors (please note the, unlike -regress-, -xtreg- calls cluster-robusy standard errors with both -robust- and -vce(cluster panelid)- options);
    4) you need to add -i.year- in the right-hand side of your -xtreg,fe- equation;
    5) you ay want to take a look at the community-contributed programme -reghdfe-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo,

      thank you very much for your feedback. It already helped me a lot

      Comment

      Working...
      X