Announcement

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

  • Can I use reghdfe for time invariant dependent variable?

    Good part of the day!
    I have a dataset with 6,465 variables, where independent variables vary in time, whereas the dependent variable is time-invariant. I take 2019-2021 as observation years and I have the variable Severity of loss, which is calculated by using stock codes from all 3 years (2019-2021). However, this variable has the same value for all 3 years. I would like to use industry and year fixed effects and found out that -reghdfe- can be used. I am taking -reghdfe Severityofloss independentvariables, absorb(year industrycode). Can I run this regression without dropping 2 years even if Severityofloss does not vary over time?

  • #2
    Well, you can, but I don't think you'll be happy with the results. In fact, I'll save you the time and trouble of running the regression: your regression coefficients will all be zero. That's what happens when the dependent variable is time-invariant in a fixed effects model.

    Comment


    • #3
      Originally posted by Clyde Schechter View Post
      Well, you can, but I don't think you'll be happy with the results. In fact, I'll save you the time and trouble of running the regression: your regression coefficients will all be zero. That's what happens when the dependent variable is time-invariant in a fixed effects model.
      Then, from my understanding, I have to leave only one observation year. Can I still use -reghdfe- if I take one year (2019) as an observation year and absorb only by industry?
      I am also confused after comparing the results for -reghdfe- and -xtreg, fe-. From what I read before, both regression methods use similar logic, but for my dataset, I get the results with -reghdfe- but no results with -xtreg, fe-. What can be the potential reason for that? Does it mean that there are some problems with my data?

      Comment


      • #4
        reghdfe is from https://github.com/sergiocorreia/reghdfe (FAQ Advice #12). This command can estimate a wide range of models. If you have fixed effects at the unit level, Clyde is correct that you cannot get estimates with a time-invariant outcome. In your case, you can consider your model to be pooled OLS with industry dummies. In this case, the equivalent xtreg, fe command that replicates

        Code:
        reghdfe y x1 ... xn, absorb(industry)
        is

        Code:
        xtset industry
        xtreg y x1 ... xn, fe

        Comment


        • #5
          Originally posted by Andrew Musau View Post
          reghdfe is from https://github.com/sergiocorreia/reghdfe (FAQ Advice #12). This command can estimate a wide range of models. If you have fixed effects at the unit level, Clyde is correct that you cannot get estimates with a time-invariant outcome. In your case, you can consider your model to be pooled OLS with industry dummies. In this case, the equivalent xtreg, fe command that replicates

          Code:
          reghdfe y x1 ... xn, absorb(industry)
          is

          Code:
          xtset industry
          xtreg y x1 ... xn, fe
          Just to be sure, will I still be able to run -reghdfe y x, absorb(industry)- if all my observations are restricted to one year (2019) and all data is annual? This means that the data is no longer panel. Then I should use -reg y x i.industrycode- ?

          Comment


          • #6
            Correct.

            Code:
            reghdfe y x, absorb(industry)
            and

            Code:
            reg y x i.industry
            are equivalent. As you note, you are estimating a linear regression model that includes industry dummies. Nothing more.

            Comment


            • #7
              Thanks for help!

              Comment

              Working...
              X