Announcement

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

  • FGLS for panel data

    I have a panel data N=46, T=4, with time invariant variable. Hausman test tells me I should do fixed effects, but because of the time-invariant I guess I have to do Random effects. The model is heteroscedastic and have serial correlation, based on modifed Wald test and Wooldridge. Thus, I need to use FGLS. Below is what i have done. Can anyone confirm if this looks correct? Is Wooldridge test on 1sr order autocorrelation the same one we are specifying in the xtgls by (corr AR1)? I also tried xtreg re vce (robust) and totally different results. Which one is correct and which one should i use? Any advice how do i pull off FGLS for my model? Thank you very much! I have been working on this for more than a month now...

    . xtgls FDI_plus_1_ln GDP_ln TI GC CIT Edu Imp PI Yr15 Yr16 Yr17 Yr18 Yr19, panels(hetero) corr(ar1)

    Cross-sectional time-series FGLS regression

    Coefficients: generalized least squares
    Panels: heteroskedastic
    Correlation: common AR(1) coefficient for all panels (0.3361)

    Estimated covariances = 46 Number of obs = 276
    Estimated autocorrelations = 1 Number of groups = 46
    Estimated coefficients = 13 Time periods = 6
    Wald chi2(12) = 1431.97
    Prob > chi2 = 0.0000

    ------------------------------------------------------------------------------
    FDI_plus_1~n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    GDP_ln | 2.016305 .1019315 19.78 0.000 1.816523 2.216087
    TI | -.0050162 .0075715 -0.66 0.508 -.0198561 .0098236
    GC | -.2146487 .096893 -2.22 0.027 -.4045556 -.0247419
    CIT | 5.900017 4.376703 1.35 0.178 -2.678164 14.4782
    Edu | 14.13463 2.499647 5.65 0.000 9.235416 19.03385
    Imp | 1.413051 .9549068 1.48 0.139 -.4585319 3.284634
    PI | -.0000446 .0000154 -2.89 0.004 -.0000748 -.0000143
    Yr15 | .0166233 .1242356 0.13 0.894 -.2268741 .2601206
    Yr16 | .0279643 .1446263 0.19 0.847 -.255498 .3114266
    Yr17 | -.1400918 .1546937 -0.91 0.365 -.4432858 .1631022
    Yr18 | -.3144913 .1659963 -1.89 0.058 -.6398382 .0108556
    Yr19 | -.789393 .175671 -4.49 0.000 -1.133702 -.4450841
    _cons | -20.50538 1.113038 -18.42 0.000 -22.68689 -18.32386
    ------------------------------------------------------------------------------

    . xtreg FDI_plus_1_ln GDP_ln TI GC CIT Edu Imp PI Yr15 Yr16 Yr17 Yr18 Yr19, re vce (robust)

    Random-effects GLS regression Number of obs = 276
    Group variable: ID_States Number of groups = 46

    R-sq: Obs per group:
    within = 0.0450 min = 6
    between = 0.8504 avg = 6.0
    overall = 0.7531 max = 6

    Wald chi2(12) = 475.61
    corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000

    (Std. Err. adjusted for 46 clusters in ID_States)
    ------------------------------------------------------------------------------
    | Robust
    FDI_plus_1~n | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    GDP_ln | 2.242274 .2859811 7.84 0.000 1.681762 2.802787
    TI | .0015489 .012926 0.12 0.905 -.0237856 .0268835
    GC | -.2401492 .1370945 -1.75 0.080 -.5088495 .028551
    CIT | 9.938618 9.922991 1.00 0.317 -9.510088 29.38732
    Edu | 9.374441 6.799565 1.38 0.168 -3.952462 22.70134
    Imp | -1.002315 2.87342 -0.35 0.727 -6.634114 4.629484
    PI | -.0000361 .0000376 -0.96 0.337 -.0001099 .0000376
    Yr15 | -.1945159 .1619585 -1.20 0.230 -.5119487 .122917
    Yr16 | -.1606619 .1771356 -0.91 0.364 -.5078413 .1865175
    Yr17 | -.0735213 .1829888 -0.40 0.688 -.4321728 .2851303
    Yr18 | -.3672885 .2175022 -1.69 0.091 -.7935851 .059008
    Yr19 | -.8331632 .2848401 -2.93 0.003 -1.39144 -.2748868
    _cons | -22.47016 2.594245 -8.66 0.000 -27.55478 -17.38553
    -------------+----------------------------------------------------------------
    sigma_u | .81412037
    sigma_e | .94769178
    rho | .4246185 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------


  • #2
    No, this does not sound correct. You have a large N small T panel, and the appropriate set of commands to deal with such data re in the -xtreg- and also in -xtgee-.

    Comment


    • #3
      Nathan:
      as an side to Joro's helpful reply, I fail to follow how you could have run -hausman- with non-default standard errors (as they're not supported).
      Hence, you shoud impose the -robust- or -cluster- options to your standard errors before running -xtreg- and then rely on the community-contributed programme -xtoverid- to test which of the two specifications fit your data better.
      For the future, please use CODe delimiters to post what you typed and what Stata gave you back. Thanks.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Many thanks for your responses. I will try to figure out that code delimiters - last time i was unable lol. I ran the xtoverid on both robust fixed and robust random models and still got fixed model as preferred (p<0.0000). But i don't know what to do as my model requires me to use time-invariant variable and random effect is the only way to include that? what would your suggestions? How do i justify?

        Also, for the option cluster, am i correct to use the states/ my IDs? I got the same results for my xtreg re vce robust and xtreg re cluster (States1) States1 is my N, or the units. And also, do i ran xtgee just by itself with my y and x or do i need to specify anything, what would you suggest? I got similar results to the above re cluster and re vce robust. Is that all and correct what i have done to correct for first-order autocorrelation and heteroscedasticity? I was told by my supervisor to use FGLS in case of the above problems. In case i use xtgee or xtreg re vce robust, what do i say? is it the same as FGLS? I apologize in advance for stupid questions. Also, I have noticed that Woolrdridge test is for only fixed model, is that a problem?

        Comment


        • #5
          Nathan:
          you may want to take a look at the community-contributed programme -mundlak- if you do not want to switch to -re- specification.
          You're correct about clustering your standard errors on your -panelid- and, as expected, under -xtreg- -robust- and -cluster- options produce the very same output.
          Basically, going FGLS means invoking options that deal with OLS disturbances such as heteroskedasticity, autocorrelation and cross-panel correlation.
          Two asides:
          - I increase your knowledge of econometrics studying one of the many textbooks that are reported in -xtreg- reference section (see related entry in Stata .pdf manual);
          - discuss every single step of your reserach strategy with your suprevisor, just to avoid problems/issues/panic during the final trait of your approaching to dissertation drafting/discussion.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Thank you. I performed Mundlak test and the preference is again for fixed effect. So I guess my main problem now is do i go ahead with random effect robust model or? Does that mean that my random model is wrong? How do i account for my time-invariant model? I saw H-T approach, but i am not sure i can figure out my endog and exog variables. Do i do hybrid model? Also, for some reason the fixed effect model brings results that are odd - education has negative effect on FDI although it should be positive and i don't know why the fixed effect is producing such result... is xtpce command not recomended for my case? Thank you!

            Comment


            • #7
              Is there an easy/ straightforward way on Stata to check all the assumptions of the fixed or random effects? e.g. i keep reading about the strict exogeneity assumption and Covariates in each time period are uncorrelated with the idiosyncratic error in each time period, etc.

              Comment


              • #8
                Dear Carlo and Joro, where can i find a reference that says xtgls is for T>N and xtgee is for N>T? i searched and couldn't find "official" reference, i need to show it to my supervisor. I have 46 states (N) observing for 6 years (2014-2019) (T). My N>T, so i should use xtgee, correct? Thank you so much!

                Comment


                • #9
                  Nathan:
                  from Example 2 in Stata .pdf manual you can see that -xtgee- is uded for N>T panel dataset.
                  It has the advantage to be more flexible than, say, -xtreg, pa-.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Hello! I just read this discussion and want to confirm something. As I'm still quite new to this, I'm a bit confused. If T < N , I should use 'xtgee' or `xtreg` fe or re. If T > N, I can consider `xtgls` or `xtscc` or 'xtpcse'. My question is: if T is only 9 and N is only 8, should I still use `xtgls`, 'xtscc' or 'xtpcse'? I don't have cross-sectional dependence issues, but I do have heteroskedasticity and autocorrelation problems.

                    Comment


                    • #11
                      Nur:
                      welcome to this forum.
                      Assuming you have a continuous regressand, my first move would be -xtreg,fe vce(cluster panelid)-.
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment

                      Working...
                      X