Announcement

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

  • Time Fixed Effects

    Dear Stata users,

    For my analysis, I need to use time fixed effects on my panel data (Country-Year), since most of the variation of my variables is between rather than within.

    I am aware on how to use country specific fixed effects, "xtreg -fe", and that it is similar to using the command regress with i.Country in the end.

    Based on this reasoning at the moment, I am conducting my analysis using the command reg -i.Year, but I observed that I do not get similar results when I run my regressions using xtreg and -be in the end.

    Could someone clarify to me how I am wrong in my reasoning, and if I am what is the correct way to conduct my analysis using time fixed effects with the xtreg command.

    My main issue is that I would like to examine the possibility of autocorrelation of the errors across countries with time fixed effects and I have not found an appropriate way to do so without using the "xtreg" command.

    I appologize beforehand if my question is confusing or incorrect, please let me know if there is any need for clarification.

    Kind Regards,

    Georgios

  • #2
    Georgios:
    1) you can add -i-year- as predictor in the right-hand side of your -xtreg,fe- equation;
    2) if you have panel -wise effect, -xtreg,fe- will highlight is (if you use default standard errors), wheres -regress- does not.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo,

      Thank you very much for your quick response:

      1) I am sorry I just observed that I did not mention this anywhere, but I do not want to include country dummies in my analysis.

      Specifically my model at the moment has the form, "reg y depvar1 depvar2 .. i.Year, robust" (At the moment, I am assuming autocorrelation between countries).

      My main concern is whether this is a correct way to use solely time fixed effects without country fixed effects and if yes, how can I examine the existence of autocorrelation in my regression?


      2) Could you please clarify this point a bit further? I am sorry but I did not understand.

      Kinds regards,
      Georgios

      Comment


      • #4
        Georgios:
        1) if you have panel data and you're interested in -fe- specification, your first choice should not be -regress-, but -xtreg,fe-:
        Code:
        xtset Country Year
        xtreg y depvar1 depvar2 i.Year, fe vce(cluster Country)
        That said, your -regress- code is not correct, as for -fe- specification, it should have been:
        Code:
        regress y depvar1 depvar2 i. Country i.Year, fe vce(cluster Country)
        3) to test for autocorrelation after -xtreg,fe-, you may want to take a look at the community-contributed command -xttest2- (juat type -search xttest2- to spot and install it).
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Dear Carlos,

          But what if I do not want to include country dummies as fixed effects but only time dummies? With the xtreg, fe command I undertand that I am including country dummies in my regression.

          For more clarity, I am attaching a reference of one of the empirical frameworks that I am following. Which in my understanding, the writter clarifies that she is using time fixed effects without country fixed effects. The part im referring to is on page 9, footnote 8 of the pdf file.

          Please excuse me for insisting.

          Kind Regards,

          Georgios

          References
          Chenyue, H. (2020). Industrial specialization matters: A new angle on equity home Bias. Journal of International Economics, 126. doi:https://doi.org/10.1016/j.jinteco.2020.103354


          Comment


          • #6
            Georgios:
            I cannot read the article, as it is behind a pay-per-view wall.
            That said, if, for any reasons, you want to consider -i.Year- only, you should go -regress-:
            Code:
            regress y depvar1 depvar2 i.Year, fe vce(cluster Country)
            If what above is what you want, standard errors should be clustered, as the observations belonging to the same panel are not independent: hence, testing for autocorrelation is redundant.
            That said, I neither understand, nor sponsor your approach (but that could well be my entirely fault).
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Dear Carlo,

              I am thinking that i should probably present both methods in my analysis, the one of Hu (2020), with time only fixed effects and robust standard errors (in order to gain comparable results), and also present my results using xtreg, fe cluster (Country).

              I am including the quote I wanted to show you in case you are interested:
              " I do not add country fixed effects since most of the variation is across countries rather than within countries. Within- country variations are largery driven by temporary fluctuations or data noise. This is due to the fact that the panel data cover a short period, while it takes a long time for countries' industrial structures and portfolio holdings to be adjusted". (Hu, 2020)

              Thank you very much for your help.

              Kind Regards,

              Georgios

              Comment


              • #8
                Georgios:
                another issue, following the quote that you were kind enough to share, is that, if the most interesting variations are between panels (and not within the same panel), -fe- specification might be outperformed by the -re- one.
                How to test which one (I mean -xtreg,fe- vs -xtreg,re-) fits your data better?
                If you go default standard errors (SEs), see -hausman-; if you go (as it would seem from your previous posts) go non-default SEs, you should switch to the community-contributed command -xtoverid-.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Dear Carlo,

                  The result of my Hausman test strongly suggests to use ,fe (p= 0.0001) & the modified wald test,-xttest 3-, implies evidence of heteroskedasticity (p=0.000). This is an additional reason I want to include both sections in my analysis.
                  I will read about -xtoverid- thank you for your suggestion.

                  Kind Regards,
                  Georgios

                  Comment


                  • #10
                    Georgios:
                    -hausman- does not support non-deafault standard errors: how could you get any result from it?:
                    Code:
                    . use "https://www.stata-press.com/data/r16/nlswork.dta"
                    (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
                    
                    . quietly xtreg ln_wage c.age##c.age, fe vce(cluster idcode)
                    
                    . estimate store fe
                    
                    . quietly xtreg ln_wage c.age##c.age, re vce(cluster idcode)
                    
                    . estimate store re
                    
                    . hausman fe re
                    hausman cannot be used with vce(robust), vce(cluster cvar), or p-weighted data
                    r(198);
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      Carlos,

                      This is the procedure I used for the results I mentioned in my previous post:

                      1) I followed the methodogy you posted, using the -xtreg command, without specifying the type of standard errors.

                      2) I run the -xtreg, fe- since using fixed effects is what the hausman result suggests.

                      3) I run -xttest 3-, the results imply signs of heteroskedasticity.

                      4) Hence I should report the robust standard errors in my results (therefore my model should have the form of -xtreg, fe robust-).


                      It is my understanding that in the occasion of using -xtreg, fe- :
                      xtreg ln_wage c.age##c.age, fe robust
                      xtreg ln_wage c.age##c.age, fe vce(cluster idcode)

                      provide the same standard errors. Right?

                      Kind Regards,

                      Georgios

                      Comment


                      • #12
                        Georgios:
                        your understanding about -robust- and -cluster- options doing the very same job under -xtreg- (however, this does not hold for -regress-) is correct.
                        What is not correct in your procedure, is running -hausman- and then invoking non-default standard errors.
                        The correct approach requests that you switch to the community-contributed command -xtoverid-.
                        Please note that, being a bit old-fashioned, the glorious community-contributed command -xtoverid- does not support -fvvarlist- notation.
                        The usual fix is prefixing your -xtreg- code with -xi:-.
                        Unfortunately, if you have interactions, the abovementioned fix does not work and you have to create interactions by hand.
                        Kind regards,
                        Carlo
                        (Stata 19.0)

                        Comment


                        • #13
                          Dear Carlo,

                          So I understand that I cannot examine the existence of heteroskedasticity and report robust SE's (if I have evidence) after I have concluded on fixed effects.

                          I will spend some time understanding -xtoverid- since its new to me.

                          Thank you for the information.

                          Kind Regards

                          Comment


                          • #14
                            Georgios:
                            that's correct.
                            The community-contributed command -xtoverid- is really helpful (set aside the minor drawbacks related to the impossibility of using -fvvarlist- notation) and it is worth practicing with it.
                            As an aside, you can run -xtreg,re- only and then -xtoverid- (ie, you do not need to run -xtreg.fe-, too): if the -xtoverid- outcome reaches statistical significance, go -fe-; otherwise stick with -re- specification (the null is that -re- is the way to go).
                            Kind regards,
                            Carlo
                            (Stata 19.0)

                            Comment


                            • #15
                              Also check out -xtdpml- for a flexible way to do this using structural equation modeling: https://statisticalhorizons.com/wp-c...s/SJ-MLSEM.pdf

                              Comment

                              Working...
                              X