Announcement

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

  • Panel model - Heteroskedasticity and Graphical representation

    Hi everyone! I am conducting my masters degree thesis, performing a panel model in Stata.
    The panel presents 435 obs (14 Countries, 7 regressors plus one dependent variable) over a time period of 31 years.

    I have few questions about it:

    1) xtreg $ylist $xlist i.t, fe

    ---------------------------------------------------------------------------------
    A | Coef. Std. Err. t P>|t| [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
    B | .5398605 .6526867 0.83 0.409 -.7464581 1.826179
    C | -1.22584 .2273252 -5.39 0.000 -1.673854 -.7778262
    D| .2848285 .0687312 4.14 0.000 .1493727 .4202842
    E | -.0782529 .0385532 -2.03 0.044 -.1542337 -.002272
    F | -.0969818 .0492957 -1.97 0.050 -.1941341 .0001705
    G | -.1805379 .0597618 -3.02 0.003 -.2983167 -.0627591
    H | .0757126 .0668242 1.13 0.258 -.0559848 .2074101
    |
    t |
    10 | 63.2721 65.19078 0.97 0.333 -65.20626 191.7505
    11 | 2.434284 61.99971 0.04 0.969 -119.7551 124.6237
    12 | 16.35604 61.94216 0.26 0.792 -105.7199 138.432
    13 | 6.704657 64.95812 0.10 0.918 -121.3152 134.7245
    14 | 24.61422 63.90948 0.39 0.701 -101.3389 150.5674
    15 | 35.05716 63.33764 0.55 0.580 -89.76901 159.8833
    16 | 25.04898 63.06845 0.40 0.692 -99.24667 149.3446
    17 | 32.00267 63.34279 0.51 0.614 -92.83365 156.839
    18 | 25.50102 63.1278 0.40 0.687 -98.91159 149.9136
    19 | 31.93022 65.83219 0.49 0.628 -97.81223 161.6727
    2 | -10.61925 66.37083 -0.16 0.873 -141.4233 120.1848
    20 | 81.35965 66.45193 1.22 0.222 -49.60419 212.3235
    21 | 20.53187 64.23994 0.32 0.750 -106.0726 147.1363
    22 | 37.49514 65.53777 0.57 0.568 -91.66706 166.6573
    23 | 50.67715 66.25284 0.76 0.445 -79.89432 181.2486
    24 | 64.52223 66.06358 0.98 0.330 -65.67625 194.7207
    25 | 32.95096 67.90331 0.49 0.628 -100.8733 166.7752
    26 | 30.7727 67.18906 0.46 0.647 -101.6439 163.1893
    27 | 49.39882 70.51655 0.70 0.484 -89.57558 188.3732
    28 | 45.64166 69.6468 0.66 0.513 -91.61864 182.902
    29 | 51.97158 70.94607 0.73 0.465 -87.84933 191.7925
    3 | 25.449 65.97401 0.39 0.700 -104.5729 155.4709
    30 | 68.35132 69.63756 0.98 0.327 -68.89078 205.5934
    31 | 63.49289 70.63225 0.90 0.370 -75.70954 202.6953
    4 | 7.259364 66.20922 0.11 0.913 -123.2261 137.7449
    5 | 21.68899 64.95747 0.33 0.739 -106.3296 149.7075
    6 | 49.88938 62.85986 0.79 0.428 -73.99518 173.7739
    7 | 50.99067 62.64713 0.81 0.417 -72.47466 174.456
    8 | 1.711984 63.29826 0.03 0.978 -123.0366 126.4605
    9 | 27.42332 63.14835 0.43 0.665 -97.0298 151.8764
    t | 0 (omitted)
    |
    _cons | 348.9121 157.5119 2.22 0.028 38.48679 659.3374
    ----------------+----------------------------------------------------------------
    sigma_u | 192.48491
    sigma_e | 89.258365
    rho | .82302312 (fraction of variance due to u_i)
    ---------------------------------------------------------------------------------
    F test that all u_i=0: F(14, 220) = 8.15 Prob > F = 0.0000

    -------------------------------------------------------------------------------------------------------------------------------------

    This is the first command I used, after having performed a Hausman test.
    However, the model shows heteroskedasticity. For this reason I added the option robust as follow

    xtreg $ylist $xlist i.t, fe robust

    After that, some of the regressors are no longer statistically significant

    -------------------------------------------------------------------------------------------------------
    | Robust
    A | Coef. Std. Err. t P>|t| [95% Conf. Interval]
    ----------------+--------------------------------------------------------------------------------------
    B| .5398605 1.301794 0.41 0.685 -2.252211 3.331932
    C| -1.22584 .4319171 -2.84 0.013 -2.15221 -.2994699
    D| .2848285 .1938842 1.47 0.164 -.1310117 .7006686
    E | -.0782529 .053745 -1.46 0.167 -.1935245 .0370187
    F | -.0969818 .0524593 -1.85 0.086 -.2094957 .0155321
    G | -.1805379 .0874543 -2.06 0.058 -.3681088 .0070329
    H | .0757126 .0843291 0.90 0.384 -.1051554 .2565807
    |
    t |
    10 | 63.2721 31.53995 2.01 0.065 -4.374363 130.9186
    11 | 2.434284 98.05769 0.02 0.981 -207.8785 212.7471
    12 | 16.35604 82.63481 0.20 0.846 -160.878 193.5901
    13 | 6.704657 75.78631 0.09 0.931 -155.8408 169.2501
    14 | 24.61422 80.18053 0.31 0.763 -147.3559 196.5843
    15 | 35.05716 90.59866 0.39 0.705 -159.2576 229.372
    16 | 25.04898 97.17089 0.26 0.800 -183.3618 233.4598
    17 | 32.00267 97.82723 0.33 0.748 -177.8159 241.8212
    18 | 25.50102 92.9341 0.27 0.788 -173.8228 224.8248
    19 | 31.93022 99.5029 0.32 0.753 -181.4823 245.3427
    2 | -10.61925 48.87254 -0.22 0.831 -115.4404 94.20192
    20 | 81.35965 103.4564 0.79 0.445 -140.5323 303.2516
    21 | 20.53187 96.92517 0.21 0.835 -187.3519 228.4157
    22 | 37.49514 98.0315 0.38 0.708 -172.7615 247.7518
    23 | 50.67715 107.625 0.47 0.645 -180.1556 281.5099
    24 | 64.52223 103.4354 0.62 0.543 -157.3246 286.369
    25 | 32.95096 99.50815 0.33 0.745 -180.4728 246.3747
    26 | 30.7727 91.72198 0.34 0.742 -165.9514 227.4968
    27 | 49.39882 97.99322 0.50 0.622 -160.7757 259.5734
    28 | 45.64166 101.2405 0.45 0.659 -171.4975 262.7808
    29 | 51.97158 102.7723 0.51 0.621 -168.453 272.3961
    3 | 25.449 48.87908 0.52 0.611 -79.3862 130.2842
    30 | 68.35132 110.3542 0.62 0.546 -168.3348 305.0374
    31 | 63.49289 110.8529 0.57 0.576 -174.2629 301.2487
    4 | 7.259364 52.02194 0.14 0.891 -104.3166 118.8353
    5 | 21.68899 54.32691 0.40 0.696 -94.83064 138.2086
    6 | 49.88938 53.9658 0.92 0.371 -65.85575 165.6345
    7 | 50.99067 48.1637 1.06 0.308 -52.31019 154.2915
    8 | 1.711984 58.14512 0.03 0.977 -122.9969 126.4209
    9 | 27.42332 40.0537 0.68 0.505 -58.48331 113.33
    t | 0 (omitted)
    |
    _cons | 348.9121 258.3602 1.35 0.198 -205.2155 903.0396
    ----------------+----------------------------------------------------------------
    sigma_u | 192.48491
    sigma_e | 89.258365
    rho | .82302312 (fraction of variance due to u_i)
    ---------------------------------------------------------------------------------

    Is there a way to improve significance, still controlling for heteroskedasticity and autocorrelation?

    2) In order to represent graphically for each Country (id) all the variables vs time, I performed the following commands:

    ------------------------------------------------------------------------------------------------------------
    sort t

    twoway line GDP ReDExpenditure AIPatents robusttot robusttot t, by(id)
    --------------------------------------------------------------------------------------------------------------

    However, in this way, time (t) is represented on the x axes, while I would switch x axes with y axes.
    How can I re-write the command?

    Moreover, is there a way to represent in a single graph all the Countries x all the years x all the variables?

    3) Considering the R-squared: the overall R-squared is lower than the between and the within R-square. What could be the reason?

    Thanks in advance!

  • #2
    Beatrice:
    welcome to this forum.
    I would change your query priority by chiming in with a very trivial issue: if, as it seems, you're dealing with a T>N panel dataset, -xtregar, fe- is probably the way to go.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thank you Carlo for your answer!
      I am quietly new to Stata, and I though N was the number of observations and not just the number of id.

      So, having T = 31 and N = 14 (14 Countries observed), can I proceed with -xtgls- command?
      In this case, can I still add fixed effect?

      Or do you think that -xtregar, fe- is a better option? In this case the way to test for heteroskedasticity is still the same?
      And should I perform a Haussman test not with xtreg but with xtregar?

      thank you very much again!
      Beatrice

      Comment


      • #4
        Beatrice:
        1) if you detected heteroskedasticity in a T>N panel dataset, you can go -xtgls- (that offers a suite of standard errors option);
        2) you can add fixed effect as you would do with -regress- when dealing with a N>T panel dataset.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Thank you very much for your answer and I am sorry to bother you one more time.

          Just a clarification: after having confirmed heteroskedasticity, as I said I can proceed with -xtgls- command.

          Is it correct writing the command in this way?
          ———————————————————————-
          xtgls $ylist $xlist i.t, fe
          ———————————————————————-

          Or is there another command for FEGLS?
          And should I add some specifications after fe such as -panel(hetero)?

          Thank you!

          Comment


          • #6
            Beatrice:
            in my previous point 2) I should have written -[time] fixed effect-.
            That said, you code with confirmedheteroskedasticity should be:
            Code:
            xtgls $ylist $xlist i.t, panels(heteroskedastic)
            Kind regards,
            Carlo
            (StataNow 18.5)

            Comment

            Working...
            X