Announcement

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

  • create industry dummy to control for industry in panel data

    I need to control my data not only for board size, firm size and ROA and country of origin where I already created a dummy variable where Germany has the value of 1 and the US of 0, but I also need to control for industry type. I have however around 34 different industries. Can I still create a dummy variable for those and include them in my panel data regression? And if yes: How do I create a dummy variable for a lot of industries?

  • #2
    Jodie:
    1) you can go:
    Code:
    tab industry, g(new_ind)
    2) a word of (unsolicited) advice: if you go -xtreg,fe- there's no gain in plugging -i.industry- in the right-hand side of your regression equation, unless (some) firms within the same panel are expected to switch from one industry to another as time goes by.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you!

      I used xtreg with -re- so far, so with the random effects model it should work right?

      Comment


      • #4
        Moreover, I already have the value of 0 and 1 for the countries. Can I still use numbers 1 etc for this dummy variable then or does Stata automatically create different dummy variables for me?

        Comment


        • #5
          Jodie:
          1) -i.industry- as a predictor is ok with -xtreg, re-;
          2) you can code -i.industry- from 0 (or whatever) onwards: please note:
          a) -fvvarlist- notation is by far the most effective and efficient way to deal with categorical predictors and/or interactions;
          b) no matter the starting value of your code, Stata will recode internally from 0 onwards.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment

          Working...
          X