Announcement

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

  • xtreg versus reghdfe

    Hai. I wanna ask something about my work. I do hausman test <xtreg depvar indvar, fe vs xtreg depvar indvar, re>, and the selected model is fixed effect model. I wanna add year fixed effect, industry fixed effect, and country fixed effect in my fixed effect model. when i use command xtreg fe, i.Industry and i.Country automatically ommitted by stata. My model have the issue of heterocedasticity and autocorrelation. Can i use reghdfe depvar indvar, absorb(firmid year industry country) cluster(firmid) for my model (N= 277 , t=5).

    Then, i found --> when i use reghdfe depvar indvar, absorb(firmid year industry country) cluster(firmid), main independen variabel is significant, but i use reghdfe depvar indvar, absorb(year industry country) cluster(firmid) is not significant.which one should I choose?

    Thank you.

  • #2
    Dirah:
    without further details from your side (please, read the FAQ on how to post more effectively. Thanks), you should include -firmid- within the -absorb()- list if -firmid- is your -panelid-.
    On a general note, statistical significance is much less important than giving a true and fair view of the data generating process you're investigating.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thank you for your reply and attention to this enquiry.

      My model is firms (277) in a 5-year time period across countries. Thus, the correct model is
      reghdfe depvar indvar, absorb(firmid year industry country) cluster(firmid)
      because, i can non include i.industry and i.country when using xtreg depvar indvar i.year, fe.

      Then, please allow the second question.
      When performing the Hausman test, is it still necessary to add i.Year to the model?
      xtreg depvar indvar i.year, fe
      estimates store fem
      xtreg depvar indvar i.year, re
      estimates store fem

      Or is it not necessary to add i.year?
      xtreg depvar indvar, fe
      estimates store fem
      xtreg depvar indvar, re
      estimates store rem

      which one is correct?
      I apologise if this question seems basic because I am still unfamiliar with stata.

      Comment


      • #4
        Industry and country are redundant once you use firm fixed effects unless the firm changes industry or headquarters over time. As Carlo said, the best think is to absorb firmid and year, and cluster by firmid. Without seeing output it’s hard to say more.

        Comment


        • #5
          i do reghdfe depvar indvar, absorb(firmid year industry country) cluster(firmid), and the output is below. Please help me with your advise. Thank you.

          Click image for larger version

Name:	Screenshot 2024-11-03 175209.png
Views:	1
Size:	45.6 KB
ID:	1766855

          Comment


          • #6
            If Industry and country are redundant once you use firm fixed effects, does that mean I can choose whether to use industry and country fixed effects or firm fixed effects?

            Comment


            • #7
              Dirah:
              your within R_sq is really low.
              I am under the impression that your time-varying variables have a limited within-panel variation.
              In addition, the sky-rocketing R_sq with low t values, is suggestive of multicollinearity (which is not evil per se, but warns you about checking the specification of the right-hand side of your regression equation).
              Kind regards,
              Carlo
              (StataNow 18.5)

              Comment


              • #8
                Dirah:
                if -fe- is the way to go, you should -xtset- your data with the -panelid- (firm, in your case).
                Due to demeaning, the -fe- gets rid of -industry- and -country-, because they are redundant if (as expected) they do not change within panels as time goes by.
                Kind regards,
                Carlo
                (StataNow 18.5)

                Comment


                • #9
                  when using absorb(Year Sector_Code Country_Code) cluster(CC), within r-squared increase to be 0.12. Is it still low? What is the minimum within r-square that must be achieved?

                  Comment


                  • #10
                    Dirah_
                    unfortunately, there's np such a rerefence value.
                    If your your time-varying variables have a limited within-panel variation, there's nothing you can do about that.
                    In addition, if -fe- is the way to go, you should -xtset- your data with the -panelid- (firm, in your case).
                    Kind regards,
                    Carlo
                    (StataNow 18.5)

                    Comment


                    • #11
                      Dear Mr. Carlo,

                      Should i do xtset id year or xtset id (only)?

                      Comment


                      • #12
                        Dear Mr. Carlo,
                        I do analysis like this.

                        xtset id year
                        xtreg depvar indvar, fe
                        estimate store fem
                        xtreg depvar indvar, re
                        estimate store fem

                        Model selected is fixed effect model. The i check heteroscedasticity and autocorrelation using xttest3 and xtserial. the result is p-value < 0.05 indicating heteroscedasticity and autocorrelation.

                        Can i use xtreg, re or xtgls to solve heteroscedasticity and autocorrelation and testing hypothesis?

                        Thank you.

                        Best Regard,
                        Dirah


                        Comment


                        • #13
                          Dirah:
                          1) you should -xtset- your dataset with -panelid- (mandatory) and -timevar- (unless Stata compains of repeated time values). If the latter is the casen you can simply -xtset- your dataset with the -panelid-, being aware that this solution would still allow you to add -i.timevar- among the predictors, while making time-series operators (suc as lags and leads) unavailable;
                          2) if you have, as it seems, a N>T panel dataset, and detected autocorrelation and/or heteroskedasticity you should go -xtreg,fe vce(cluster panelid)- or -xtreg,fe robust-. They both call in the cluster-robust standard error;
                          3) however, you should not add non-default standard error after -hausman- outcome
                          4) as -hausman- does not support non-default standard errors, you should consider the community-contributed module -xtoverid- (that, in turn, does not allow -fvvarlist- notation. See -help xi:- as the usual workaround).
                          Kind regards,
                          Carlo
                          (StataNow 18.5)

                          Comment


                          • #14
                            Dear Mr. Carlo,

                            I already used comman xtoverid <xtreg depvar indvar, re robust> <xtoverid>, and the p-value < 0,05. it means that the selected model is xtreg fe. So, when i using xtreg fe (firm control), i don't need to add industry control right? And when i add i.Industry, is omitted by STATA.

                            Please advise. Thank you.

                            Comment


                            • #15
                              Dirah:
                              you're correct.
                              In addition, please call me Carlo, as all on (and many more off) this forum do. Thanks.
                              Kind regards,
                              Carlo
                              (StataNow 18.5)

                              Comment

                              Working...
                              X