Announcement

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

  • 2-way cross-sectional panel fixed effects

    I would appreciate some advice on the modeling of my panel fixed effects with two cross-sectional dimensions.

    Data structure dimensions:
    Regions (1...3000)
    Companies (1...300)
    Time (1...1000)
    Obs : ~ 1 000 000

    Regions are not nested within companies, i.e., companies are observed in more than one region, but never in all regions. The panels are unbalanced.

    I need FEs for regions and for companies. FEs for any combination of regions and companies are not necessary, but it is also fine to have them by the underlying economic theory.

    I tried the following models:

    1a)
    Code:
    egen idreg_comp = group(regions companies)
    xtset idreg_comp time
    xtreg y x1 x2 x3 x4, fe
    1b)
    I also get the same point estimates by
    Code:
    reg y x1 x2 x3 x4 i.regions#i.companies
    2)
    Code:
    reg y x1 x2 x3 x4 i.regions i.companies
    2) reports different point estimates than 1a) and 1b)

    My questions
    a) Is 2) to be preferred as regions are not nested within companies resulting in correlation between fixed effects in 1a) and 1b) or does such correlation not bias my coefficient point estimates?
    b) Model 2) results in repeated time values within panels (which xt... commands do not allow ). Is this to be avoided in general?

    I would like to use the -reg- command if necessary only as it requires a few hours to run it on my dataset.

    Any help is highly appreciated.

    Thanks.

    Christian

  • #2
    Christian:
    - I would go -xtreg, fe-;
    - both you -regress- models have biased standard errors (SEs), as you did not clustered them on -panelid-. In this way, you are pretending that you have independent observations (which is not the case with panel data, no matter the regression model you want to use. By the way, there are few instances where -regress- outperforms -xtreg- when it come to panel data analysis).
    Obviously, unreliable 95%CI and p-values follow from biased SEs.
    - it is seldom the case that you can use interactions without including the main conditional fixed effects of theb terms included in the interactions.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      There is a big difference between having company and region fixed effect and including company-region pair fixed effects. Your first two codes do the latter, the last code does the first. As you mention "I need FEs for regions and for companies. FEs for any combination of regions and companies are not necessary, but it is also fine to have them by the underlying economic theory." I assume it is not the company-region pair dummies you want.

      My advice? Use Sergio Correia's reghdfe command, which is made to handle multi-dimensional fixed effects in a ridiculously fast way.

      Code:
      reghdfe y x1 x2 x3 x4, absorb(regions companies)
      I would suggest adding cluster(regions), cluster(companies) or even cluster(regions companies) to that (see also #2).

      Comment


      • #4
        Thanks Carlo for your immediate reply and valuable comment.
        I have some follow-up question:
        I would like to test a model with analytic weights changing over time within a panel: This seems to be not allowed with -xtreg, fe- .
        Do you agree that the -areg- command is appropriate for this case then?

        Code:
        egen idreg_comp = group(regions companies)
        xtset idreg_comp time
        areg y x1 x2 x3 x4 [aw=weight], absorb(idreg_comp) vce(cluster idreg_comp)
        Thanks.

        Christian

        Comment


        • #5
          Thanks, Jesse. I did not see your post, when I posted my last one...

          My advice? Use Sergio Correia's reghdfe command, which is made to handle multi-dimensional fixed effects in a ridiculously fast way.
          Wow, this is absolutely great! I was looking for such a command!
          I just tested it and I was able to replicate the results reported by -regress- with dummies.

          From 1 hour down to 10 seconds to run the command!

          Additionally, this command seems to allow many further options!

          Thank you so much Jesse!

          Comment


          • #6
            Christian:
            Jesse gave helpful advice.
            However, I suppose that -areg- and -xreg, fe- treat -aweights- in the same way (but I've never tested it).
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Can I ask a follow-up question? I kinda have the same question as Cristian, and if I understood it correctly I can use the answer provided by Jesse is #3. But just checking.
              I have multiple firms which can operate in only one Sector and one Country (of course multiple firms can operate in the same country/sector). If I want to analyze the effect of a certain variable on another, correcting for heteroskedasticity and country and sector effects (not the combined effect) using fixed effects, I can do the following regression:
              Code:
              reghdfe y x1 x2 x3, robust absorb(Sector County) cluster(Country Sector)
              Thanks in advance,

              Comment


              • #8
                The <robust> option is redundant, but apart from that I'd say yes, looks okay. (but I don't know your subject, the data etc etc)

                Comment


                • #9
                  Thank you! Based on the Hausman and Wald test I want to use FE and correct for heteroskedasticity. Furthermore, I want to analyze the effect of different Fama and French plus the leverage ratio on firm returns.

                  Comment

                  Working...
                  X