Announcement

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

  • Interaction term in fixed effects

    Hello,

    I would like to clarify the following uncertainty: I am analysing the impact of technology on different occupations and use panel data on 11 industries between 2006-2017. I have created a fixed effects model in order to look for the similar effect across all industries after accounting for individual effects, however, I would also like to look later into the different effect of computer_use for each industry. Hence, I decided to use the interaction of computer_use with industry dummies for the second model.
    However, when I use the latter regression, other variables that were significant in the first model become now insignificant. Can I still use the first regression to interpret the effect of other variables, and from the latter just refer to different effects of computer_use?
    Or does it make my results uncomparable?
    Code:
    . xtreg nonrout using_computer lngva  price_computer total_internet_access sharedegre
    > e sharehigher shareother, fe vce(robust)
    
    Fixed-effects (within) regression               Number of obs     =        120
    Group variable: industry1                       Number of groups  =         10
    
    R-sq:                                           Obs per group:
         within  = 0.3276                                         min =         12
         between = 0.4580                                         avg =       12.0
         overall = 0.4408                                         max =         12
    
                                                    F(7,9)            =      16.27
    corr(u_i, Xb)  = 0.5375                         Prob > F          =     0.0002
    
                                       (Std. Err. adjusted for 10 clusters in industry1)
    ------------------------------------------------------------------------------------
                       |               Robust
               nonrout |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------------+----------------------------------------------------------------
        using_computer |   .0014271   .0004206     3.39   0.008     .0004755    .0023786
                 lngva |  -.0193869   .0317928    -0.61   0.557    -.0913072    .0525334
        price_computer |   .0014037   .0009901     1.42   0.190     -.000836    .0036434
    total_internet_a~s |   .0041153   .0022304     1.85   0.098    -.0009303    .0091609
           sharedegree |   .0926562   .1112741     0.83   0.427    -.1590632    .3443756
           sharehigher |  -.2771514   .1359427    -2.04   0.072    -.5846752    .0303723
            shareother |   .1583427   .0836769     1.89   0.091    -.0309475    .3476329
                 _cons |    .200577   .5024723     0.40   0.699    -.9360942    1.337248
    -------------------+----------------------------------------------------------------
               sigma_u |   .1681399
               sigma_e |  .01373558
                   rho |  .99337076   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------------
    
    
    Now - with the interaction term:
    
    . xtreg nonrout c.using_computer#i.industry1 lngva  price_computer total_internet_acc
    > ess sharedegree sharehigher shareother, fe vce(robust)
    
    Fixed-effects (within) regression               Number of obs     =        120
    Group variable: industry1                       Number of groups  =         10
    
    R-sq:                                           Obs per group:
         within  = 0.4646                                         min =         12
         between = 0.0007                                         avg =       12.0
         overall = 0.0008                                         max =         12
    
                                                    F(6,9)            =          .
    corr(u_i, Xb)  = -0.7915                        Prob > F          =          .
    
                                       (Std. Err. adjusted for 10 clusters in industry1)
    ------------------------------------------------------------------------------------
                       |               Robust
               nonrout |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------------+----------------------------------------------------------------
             industry1#|
      c.using_computer |
        Accommodation  |  -.0019848   .0006782    -2.93   0.017    -.0035191   -.0004505
    Administrative ..  |   .0011701   .0002696     4.34   0.002     .0005603    .0017799
         Construction  |   .0019143   .0003306     5.79   0.000     .0011663    .0026623
    Financial and I..  |  -.0067784   .0034683    -1.95   0.082    -.0146244    .0010675
    Information and..  |   .0032694   .0010298     3.17   0.011     .0009398     .005599
        Manufacturing  |   .0017933   .0013022     1.38   0.202    -.0011526    .0047392
    Professional, S..  |  -.0004355   .0008249    -0.53   0.610    -.0023016    .0014306
          Real Estate  |   .0019032   .0002549     7.47   0.000     .0013266    .0024799
    Transportation ..  |  -.0000783   .0002766    -0.28   0.784    -.0007041    .0005475
      Wholesale trade  |  -.0000112   .0014483    -0.01   0.994    -.0032876    .0032651
                       |
                 lngva |   .0000949   .0355875     0.00   0.998    -.0804097    .0805995
        price_computer |   .0013431   .0009608     1.40   0.196    -.0008305    .0035166
    total_internet_a~s |   .0037761   .0023165     1.63   0.138    -.0014641    .0090163
           sharedegree |   .0639118   .1022921     0.62   0.548     -.167489    .2953126
           sharehigher |  -.2078717   .1323905    -1.57   0.151    -.5073598    .0916164
            shareother |   .0901104   .0656804     1.37   0.203     -.058469    .2386898
                 _cons |    .127795    .461287     0.28   0.788    -.9157087    1.171299
    -------------------+----------------------------------------------------------------
               sigma_u |   .3108439
               sigma_e |  .01283018
                   rho |  .99829925   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------------
    
    . 
    .

  • #2
    It isn't reasonable to mix findings from the two models in that way. It might be reasonable to report both models in their entirety if there is some doubt in your mind whether the interaction terms are really useful.

    I think you are over-reading your results anyway. Most of your coefficient estimates have pretty wide confidence intervals. As far as I see, all of the changes in coefficients between models fall within the confidence intervals of the original model, and all of the coefficients in the original model fall within the confidence intervals of the expanded model. So I would say that nothing has really changed much anyway.

    In both models, also, you are really pushing a large number of variables into a model that you are fitting to only 120 observations and 10 groups.

    Comment


    • #3
      Hi Clyde,

      Hope it is ok, that I continue this thread a bit. I was wondering if you can elaborate on the issues that might occur when using too many variables in the model and if you might have some literature on this?

      I am researching energy poverty at the moment in EU countries, and I think I might be fitting too many variables into my model.
      I have 130 obs, 17 groups, t=2007-2014 and I am trying to fit 17 variables into my model. I am using this amount of variables because I am trying to control for as much as possible.
      I am researching if a state's welfare generosity (I have 4 variables for this) affects the degree of energy poverty observed and if the level of renewables consumed in a country also affects this (1 variable).
      My main goal with including 12 control variables is to control for different circumstantial aspects. The biggest part of my control variables is energy prices, where I have included energy prices by source in my dataset and have 7 variables on this. Do you think, that I should consider using one 'total' variable instead of the seven source-specific ones and would this be a good enough adjustment, so I don't have to exclude more of my control variables?

      Hope you can help me with making some sense of this.

      - Anne

      Comment


      • #4
        Anne:
        welcome to this forum.
        How can interested listers help you out without reading what you typed and what Stata gave you back (as recommended by the FAQ, that first-time [as well as n-time] posters are kindly requested to read [and/or rehearse])? Thanks.
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment


        • #5
          Hi Carlo,
          I will try and upload my outputs as per the faq - thanks for the recommendation.

          I am experiencing multiple issues as this is my first time dealing with panel data. I have, of course, tried following other threads in this forum to accommodate these issues, but I will describe them below.

          As mentioned above, I am researching if welfare generosity affects energy poverty levels in EU countries. I have four generosity measures based on previous literature from the relative income poverty literature, seeing as energy poverty is quite a new subject to be addressed in an EU context in the political science world, which is my perspective.

          Now as for the coding. I am not sure, i am doing this correctly, so please let me know if I should do it some other way or include more information.
          First an output and summary of my data
          Code:
          * Example generated by -dataex-. For more info, type help dataex
          clear
          year cntryid float(tincw hhep hhgp dipa ddpa noren noown povri ewmd epad epel epop epug wgswe wgsst wgge wgphs rec)
          2007  1  4.13  17.4  6.1 25.2 35.4 1.4 1.7 16.7  9.1  92.33  78.12  93.29  93.35 25.09 19.4 49.2 74.37 29.03
          2008  1  6.15 17.76 6.01 24.5 36.5 1.3 1.7 20.6   12  110.5  88.04 106.02 100.73 25.52 19.6 49.9 74.96 29.76
          2009  1   6.2 19.09 6.35 25.4 35.9 1.4 1.8 19.1 19.7  86.85  92.16  86.96  87.01 27.47 21.2 54.1  75.1 31.29
          2010  1   6.7 19.49 6.12   25 35.8 1.4 1.8 18.9  9.1  98.64   97.4 100.73  98.99 27.56 21.4 52.8 74.65 31.13
          2011  1  5.83 19.76 7.08 25.4 36.6 1.4 1.8 19.2   11 118.67   98.2 117.36 113.12 26.74 20.7 50.9 74.61 31.64
          2012  1   5.5  19.5 7.61 28.1 30.2 1.4 1.8 18.5 15.2  125.8  98.93  125.5  120.7 27.11 20.9 51.2 74.68 34.28
          2013  1  5.63  20.5 7.61 29.5 29.7 1.4 1.7 18.8 12.8 121.06 102.57 120.34 115.88 27.52 21.3 51.6 74.01  34.7
          2014  1  4.98 20.04 7.39 29.4 29.8 1.3 1.7 19.2  6.7 115.95 100.75 115.41  112.3 27.73 21.5 52.4 74.01 35.79
          2007  7  8.25 24.01  8.5 41.7 33.3 1.8 1.9 16.8  9.5  88.42  88.47  87.15  87.93 25.91 21.5 49.6 83.71 17.68
          2008  7  3.58  27.1 9.69 41.3 33.3 1.8 1.9 16.3 11.5  101.8  95.34     93  92.63 26.32 21.6 50.4 84.02 18.53
          2009  7  3.35 26.27 8.27 41.4 33.6 1.8   2 17.6 18.5  83.77  92.33  84.52  86.01 29.28 24.3 56.5 84.46 19.32
          2010  7  3.75 26.89  9.6 41.9 33.4 1.8   2 18.3 10.3  96.51  93.75  96.95  96.88 29.64 24.8 56.7 83.88 21.18
          2011  7  6.08 29.42 10.3 39.9 33.6 1.8 1.9 17.6 11.2 112.07 102.67 108.44 107.56 29.78 24.7 56.4 83.61 23.81
          2012  7  6.53 29.85 9.68 21.7 33.7 1.9   2 17.5 10.6 118.63 104.04 115.03 113.88 29.93 24.6   58 83.98 26.91
          2013  7  6.95 29.68 9.85 20.3 34.2 1.8   2 18.3 19.1 121.29  98.48 115.84 114.07 29.89 24.5 55.8 84.26  27.1
          2014  7  6.35 30.39 8.93 20.6 34.2 1.9   2 17.9  7.3  114.6 100.52 110.45  109.1 29.88   24 55.2 84.19 30.23
          2007  8  8.38  7.86 2.63  2.6 46.2  .9 1.2   22   12  80.43  59.86   79.6  79.68 12.37    9 33.7 75.92 18.55
          2008  8  6.68  8.32 3.53  2.9 46.1   1 1.2 21.8    9 106.26  63.69  94.62   94.5 15.12 11.3 39.5 76.98 20.24
          2009  8   8.4  9.21 3.79  3.6 45.9   1 1.2 23.4  7.2  84.03  70.84  83.36  83.46 19.31   15 45.9 77.87 24.08
          2010  8     9  9.87 3.82  3.4 45.7   1 1.2 21.7  6.1 102.53  76.29 100.72 100.77 17.99 13.8 40.3 76.33 25.39
          2011  8  9.25 10.08 4.28    3 45.7 1.4 1.6 23.1 12.5 117.65  78.12 112.56 112.45 16.04 12.2 37.4 76.69 25.09
          2012  8  9.68  11.1 5.09 16.9   42 1.4 1.6 23.4 15.5  127.3     86 123.52  123.4 15.64   12 39.2 76.65 25.02
          2013  8  8.43 13.59    5 17.1 42.1 1.3 1.5 23.5   17  122.7 104.73 119.06 118.96 15.58 11.6 38.4 75.61 24.55
          2014  8  7.33 13.16 4.93 15.7 43.1 1.3 1.7   26   10 117.44 101.27 115.18  115.1 15.95 11.5 37.8 75.68 25.49
          2007 10   9.9    14 5.81 20.9 51.9 1.6 1.9 23.3   19   85.9  53.97  85.41  84.28  20.9 12.8 39.3  72.3  9.01
          2008 10   8.3 14.62 6.14 22.1 51.2 1.6 1.9 23.8 18.3 101.32  59.03   94.4  90.22 22.33 13.8 41.4 73.28  9.74
          2009 10  9.75 16.31 5.73 22.1 51.4 1.6   2 24.7 20.5  81.69  65.14  81.88  81.65 25.61 16.1 46.2 75.07 12.23
          2010 10 11.08  17.9 5.37 22.3 51.2 1.7   2 26.1 14.2  96.37  70.65  96.25  94.87  24.9 16.7   46 74.44 14.41
          2011 10   8.7 20.35 5.38 22.1 50.8 1.6 1.9 26.7 17.1 113.83  80.61 110.43 107.47 25.53   17 46.2 73.48 14.77
          2012 10  9.43 22.33 7.62 22.9 50.4 1.6   2 27.2 29.2 122.35  88.53 119.68 116.01 25.55 17.8 48.7 72.11  15.8
          2013 10 10.25 22.51 8.12 23.3 49.9 1.6   2 27.3 15.7 121.81  87.34 119.64  116.6  25.7 18.2 45.8 71.01 16.96
          2014 10 12.13 22.66 8.56 22.5 51.1 1.6   2 29.2 20.1 117.13  97.31 115.44 112.97 25.37 17.9 45.1 70.26 17.37
          2007 12  7.33 12.22 5.15 34.9 47.2 1.4 1.8   19 11.5  94.51   70.3  93.16  93.83 28.28 21.7 52.6 77.02  9.45
          2008 12  7.38 12.08  5.5 35.5 46.9 1.5 1.9 18.5 13.5 109.97  69.17 105.01  99.99 28.52 21.8 53.3 76.49  10.6
          2009 12  7.78 12.07 5.67 35.4 47.1 1.5 1.9 18.5 19.4  86.72  70.71  86.63  88.97 31.02 23.7 57.2 76.51 11.32
          2010 12  7.75 13.17 5.48 35.1 46.7 1.5 1.9 19.2 12.6  99.12  76.61  99.44  99.09 31.08 23.7 56.9 76.26 11.99
          2011 12   7.5 14.03 6.13 35.6 46.2 1.5 1.9 19.3 13.2 115.66  82.63 114.17 110.57 30.78 23.7 56.3    76 10.83
          2012 12  7.88 14.47 6.59 19.7 45.8 1.5 1.9 19.1 18.3  120.9  85.12 121.31 115.51 31.21 24.2 57.1 76.09 12.53
          2013 12  8.05  15.6 7.04   20   46 1.5   2 18.1 18.4 116.89  90.33  118.3 113.37 31.71 24.5 57.2 76.23 13.57
          2014 12  7.88 16.44 7.32 19.8 45.2 1.5   2 18.5   11 111.53  94.49 112.47 109.58 32.03 24.5 57.2 76.47 13.35
          2007 14  14.6 12.96 3.82 20.6 31.7  .7 1.1 29.4  8.3  73.64  96.64  77.29  77.29 22.42 17.2 49.8 68.87     9
          2008 14  16.1 15.51 4.35 20.9 31.4  .7 1.1 28.2  9.6  86.18 108.07  82.02  82.02 22.66 17.4 48.7 68.87  8.96
          2009 14 13.25 15.73 4.79 20.1 31.7  .8 1.1 29.6 13.3  75.16 116.48  79.49  79.49 23.25   18 50.5  68.3 12.29
          2010 14 16.93 16.38 5.45 20.4 31.4  .8 1.1 29.9  8.1  89.76 126.96  94.49  94.49    23 17.2 48.8 67.08 13.46
          2011 14  17.3 16.18 5.66 21.4 30.7  .8 1.1 31.5 12.3 106.07 122.72 106.97 106.97 22.31 16.8   49  66.5 14.74
          2012 14 19.78 15.84    5 33.7 29.2  .9 1.1 33.5 13.5 121.23  128.3 119.19 119.19  22.6 16.6 49.1 65.51 16.47
          2013 14 20.23 13.62 4.26 32.7 29.8  .9 1.2 34.8 12.1 118.92 113.75 116.62 116.62 22.22 16.4   50 66.62 17.18
          2014 14  18.1 11.74 3.58 31.1 29.3  .9 1.2 31.8  9.5 116.11 102.88 113.59 113.59 21.46 15.3   50 67.08 15.72
          2007 15     7 19.18 6.07 29.1   34 1.6 2.1 23.1 16.3  86.09  78.14  83.06  81.73 16.23 12.8 35.6 79.23  3.53
          2008 15   6.9 19.01 5.97 28.4 34.2 1.7 2.1 23.7 14.9 101.41  80.32  92.08  89.69  19.2 15.1 41.6 79.32  4.14
          2009 15  8.15 19.43 5.97 28.2   34 1.6 2.2 25.7 21.4  81.29  80.68  81.45  80.51 23.11 17.7 46.9 77.07  5.22
          2010 15   9.7  18.4 5.12 27.7 33.1 1.7 2.2 27.3 15.2  96.09  77.18  97.02  95.24 23.78 17.5 64.9 76.18  5.24
          2011 15  9.88 19.94 5.64 27.4 34.2 1.7 2.2 29.4 15.8 112.67  81.97 111.09 108.49 22.96   16 47.3 71.89  6.68
          2012 15  11.8 22.22 6.43 25.6 35.1 1.7 2.2 30.3 15.7 123.98  92.44 121.69 118.39 22.57 15.8 42.5 71.75  6.58
          2013 15 13.05  23.5 6.88 25.1 35.4 1.6 2.2 29.9  6.9 120.93   96.9 119.68 116.43 21.45   15 40.6 70.59  7.35
          2014 15  12.6 24.72 7.13 24.4 39.7 1.6 2.2 27.7 17.3 115.95 101.13 114.05 111.75 19.65 13.6 37.6 71.01  8.44
          2007 16 13.28     . 6.36   40 43.2 1.2 1.4   26 10.6  82.76  76.07  85.94  84.46 24.05 17.4 46.8 77.49  8.73
          2008 16 14.33 21.29 6.75 39.4 43.9 1.2 1.4 25.5 17.3   95.6  83.07  91.83  89.78 24.99   18 47.8 77.68 10.82
          2009 16 13.45 20.48 6.46 40.1 43.7 1.2 1.5 24.9 16.7  76.88  84.76  81.38  80.21 27.02 19.7 51.1 78.31 12.54
          2010 16 13.73 19.43 7.02 39.9 43.6 1.2 1.5   25  9.3  86.46  80.77  90.06   88.7    27 19.7 49.9 78.45 12.79
          2011 16 17.75 20.26 7.85 40.8 43.3 1.2 1.4 28.1 15.3 102.97  82.13 102.82 101.12 26.61 19.5 49.2 77.01  11.9
          2012 16 18.93 22.15 8.69 41.2 43.1 1.1 1.4 29.9 21.3 121.29  91.43 117.12 116.15 27.29 20.3 50.6 75.88 14.39
          2013 16  18.1 23.08  8.9 40.5 44.1 1.1 1.4 28.5 13.6  117.9  95.06 114.59 113.69 27.89 20.9   51 75.76 16.32
          2014 16  18.3 23.92 8.74 41.1 43.4 1.1 1.4 28.3   14 114.48  98.82 111.93 111.33 28.16 21.1 50.9 75.43 17.13
          2012 17  24.6 12.64 5.61 10.3 42.4   1 1.6 32.5  8.2 124.63 101.57 123.02 122.24  16.5 13.3 36.2 67.32 23.92
          2013 17 22.88 13.81 6.09  9.8 42.5  .9 1.5 30.8   16 123.76 110.43 119.62 119.08 15.49 12.5 35.6 66.25 26.34
          2014 17 20.58 13.25 5.29 10.5 42.8  .9 1.5 27.3  6.1  118.5 105.86 114.51 114.05 15.63 12.6 34.7 67.56 27.73
          2007 18   4.4 16.65 3.64   32   46 1.5   2 15.9  9.9  91.76  99.06  96.22  95.57 20.21 15.1 37.4 84.19  3.64
          2008 18  4.78 16.27 5.36 31.8 45.5 1.4   2 15.5  9.4 108.78  86.71 105.94  100.3 21.94 15.5 37.9 87.33  3.96
          2009 18   5.1 18.82 4.77 31.5 46.4 1.5 2.1 17.8 19.7  82.95  99.88  87.57  88.15 24.04 17.7 42.7 85.75  3.73
          2010 18  5.08 17.37 4.54 33.4 43.1 1.5 2.1 17.1 12.9  97.84  95.65 100.79  99.06 23.14 17.1   42 84.91  3.68
          2011 18  4.88  16.7 5.45 34.9 42.6 1.5 2.1 16.8 12.5 114.52  93.47 114.12 109.71 21.19   17 41.5 83.16  3.76
          2012 18  5.13 17.01 5.86 37.8 15.9 1.5 2.2 18.4  9.5 123.36  95.76 123.77 117.72 22.07 17.3 41.8 82.85  4.15
          2013 18   5.4 16.56 5.95   38 14.6 1.5 2.1   19 19.8 119.53  92.29 119.14 113.71 22.27 17.7 41.2 83.09  5.72
          2014 18  4.85 17.38 5.23 36.6 14.5 1.5 2.2   19  9.9 114.33  97.47 113.73 109.88 21.85 17.5 40.6 83.48  6.85
          2007 19 19.05  7.29 3.11  1.7 46.3  .8   1 35.1 16.6  84.56  44.13  80.66  80.62 11.08  7.9 34.5 60.87 33.08
          2008 19 17.78  9.23 4.07  3.2 47.1  .8   1 34.2  8.5  103.2  56.44  90.96  90.83 12.99    9 38.3 60.33 33.71
          2009 19 19.13 10.53 4.51  2.9 46.7  .9   1 37.9  8.1  86.95  65.01  85.12  85.34 18.09 13.9 45.1 59.65  38.4
          2010 19 21.35 10.49  3.6  2.3 46.7  .8   1 38.2  9.5 101.32  65.05  97.69  97.42 19.47 14.1 45.8 60.19 33.07
          2011 19  23.6 12.55 4.22  2.9 46.1   1 1.2 40.1 10.8 120.72  77.27 115.13 114.13 16.58 12.6 42.3  63.5 35.54
          2012 19  22.6 13.76 5.36    8 45.3   1 1.3 36.2   15 128.44  81.95 125.36  124.1 15.36 11.4 38.8 60.35 40.37
          2013 19 22.65 13.68 5.05  8.9 43.3   1 1.3 35.1 20.1 123.25  81.59 120.64 119.66 15.53 11.6 38.5 60.01  39.6
          2014 19 20.18 13.33 4.86  9.7 43.4   1 1.3 32.7  5.8  118.6  82.18 115.18 114.28 15.35 11.4 38.9 59.67 40.24
          2007 21  5.93  17.5 7.16 34.8 62.8 2.3 1.9 15.7 10.3  88.32 111.52  93.66  93.66 15.74 14.5 42.5 84.08  3.68
          2008 21  5.35 17.84 7.27 35.5 62.4 2.3 1.9 14.9 12.6 104.54  88.98  98.66  98.66 15.48 14.8 43.2 82.68  3.94
          2009 21  4.73 19.43 7.42 34.6 63.2 2.3 1.9 15.1 17.8  80.97  99.57  86.19  86.21 17.07 16.4 47.7 83.18  4.38
          2010 21  5.48 17.78    7 33.1 64.9 2.3 1.9 15.1 10.7   95.1  89.52  96.46  96.47 17.47 16.8 47.9 83.38  3.85
          2011 21  5.05 18.02 7.38   32 66.1 2.3 1.9 15.7  8.2 109.53  91.67 105.24 105.26 17.54 16.8 46.8 82.66  4.69
          2012 21  5.73 18.57 7.92   38 47.3 2.3 1.9   15 12.3 117.33  99.37 112.86 112.89 17.93   17 46.9 82.11   4.9
          2013 21  5.95 19.02 8.27 38.5 46.8 2.2 1.9 15.9   16 115.45 103.87 111.43 111.44 18.13 17.2 46.6 81.15  4.94
          2014 21     6 18.21 8.05 40.2 45.1 2.1 1.8 16.5  6.6 114.27    102 109.42 109.43 17.93   17 45.9 81.08  5.53
          2007 22  24.9  13.8 4.01 13.1 40.1  .8   1 34.4  7.7  84.11  67.58  90.53  90.95 19.53 15.6 42.9 70.08  7.28
          2008 22 18.25 12.77 4.66 14.1   40  .9   1 30.5 11.1  94.24   75.3  93.09  92.86 20.21 15.5 44.2 71.67  8.01
          2009 22 15.68 12.11 4.25 14.7 39.3  .8   1 27.8 16.3  81.36  84.59  88.88  89.06  21.3 16.1   45 71.65  8.84
          2010 22 14.78 13.62 4.65 14.9 39.8  .8   1 27.8  4.9  95.09  87.44  98.21  98.26 20.75 16.3 45.8 71.68  9.49
          2011 22  12.9 14.11 4.82 15.2 39.8  .8   1 27.2 10.7 112.51  95.07 110.84 110.65 19.56 15.5 44.1 70.87 10.44
          2012 22 12.75 14.74 5.23 24.5 33.9  .8 1.1 26.7  7.2 126.51  100.5 123.26 123.07 19.78 15.7 43.1 70.04 10.91
          2013 22 11.73 14.59  4.9 24.3 33.3  .8 1.1 25.8 17.5 122.27 100.45 118.48 118.33 20.48 16.1   43 70.66 11.41
          2014 22  10.4 14.15 4.95 24.5 33.2  .8 1.1 24.7    8 116.28  98.14 114.04 113.93 20.18   16 42.6 70.66 11.58
          2007 23 27.13 15.62 6.53 31.1 44.3 1.3 1.5   25 28.2  91.04  67.09  92.21  92.44 21.73 14.9 44.5 62.76 23.15
          end
          Code:
          sum
          
              Variable    Obs    Mean    Std. dev.    Min    Max
                                  
              year    131    2010.557    2.307714    2007    2014
              cntry    0
              cntryid    131    16.51145    7.224282    1    27
              bincw    131    20.72855    10.45256    5.4    45.18
              aincw    131    9.254809    5.393883    2.75    23.6
                                  
              tincw    131    11.11542    6.319791    3.28    27.13
              hhep    130    17.01138    4.570348    7.29    30.39
              hhgp    131    6.375038    1.96457    2.63    12.26
              dipa    131    26.2374    10.93214    1.7    41.9
              ddpa    131    37.94122    11.07633    14.5    66.1
                                  
              noren    131    1.317557    .4056298    .7    2.3
              noown    131    1.608397    .379481    1    2.2
              povri    131    23.11374    6.122151    13.9    40.1
              ewmd    131    13.47252    5.651195    3.5    36.7
              epad    131    105.3038    14.69675    73.64    128.44
                                  
              epel    131    90.50809    15.57136    44.13    128.3
              epop    131    103.2085    13.43518    77.29    125.5
              epug    131    102.2399    12.74968    77.29    124.1
              wgswe    131    22.43557    4.77152    11.08    32.03
              wgsst    131    17.35649    3.666566    7.9    24.8
                                  
              wgge    131    46.69924    6.179177    33.7    64.9
              wgphs    131    74.47069    6.988493    59.65    87.33
              rec    131    18.54664    12.05513    3.53    49.54
          I then set my data as panel data
          Code:
          global id cntryid
          global t year
          global ylist tincw
          global xlist hhep hhgp dipa ddpa noren noown povri ewmd epad epel epop epug wgswe wgsst wgge wgphs rec
          xtset id year
          Performing the hausman test on random and fixed models
          Code:
           xtreg $ylist $xlist, fe
          
          Fixed-effects (within) regression               Number of obs     =        130
          Group variable: cntryid                         Number of groups  =         17
          
          R-squared:                                      Obs per group:
               Within  = 0.5967                                         min =          3
               Between = 0.5160                                         avg =        7.6
               Overall = 0.4947                                         max =          8
          
                                                          F(17,96)          =       8.35
          corr(u_i, Xb) = -0.1052                         Prob > F          =     0.0000
          
          ------------------------------------------------------------------------------
                 tincw | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
          -------------+----------------------------------------------------------------
                  hhep |   .0280269   .1932996     0.14   0.885    -.3556697    .4117235
                  hhgp |   .4914672   .2721962     1.81   0.074    -.0488379    1.031772
                  dipa |  -.0745511   .0314983    -2.37   0.020    -.1370748   -.0120274
                  ddpa |  -.0081977   .0306862    -0.27   0.790    -.0691093    .0527139
                 noren |   1.659452   2.747883     0.60   0.547    -3.795054    7.113957
                 noown |  -.7908194     2.7713    -0.29   0.776    -6.291805    4.710167
                 povri |   .7866492   .0971313     8.10   0.000      .593845    .9794533
                  ewmd |  -.0224301   .0322808    -0.69   0.489    -.0865069    .0416466
                  epad |  -.1133617   .0435624    -2.60   0.011    -.1998324   -.0268909
                  epel |  -.0495486   .0315256    -1.57   0.119    -.1121263    .0130291
                  epop |  -.1073209   .1337802    -0.80   0.424    -.3728724    .1582307
                  epug |   .2627188   .1329301     1.98   0.051    -.0011454    .5265829
                 wgswe |   .2540827   .2877072     0.88   0.379    -.3170116     .825177
                 wgsst |  -.4646673   .3297627    -1.41   0.162    -1.119241    .1899066
                  wgge |  -.0777319   .0663244    -1.17   0.244    -.2093848    .0539211
                 wgphs |   .1234708    .098548     1.25   0.213    -.0721455    .3190872
                   rec |  -.0151661    .085388    -0.18   0.859    -.1846599    .1543277
                 _cons |  -11.29999   8.207012    -1.38   0.172    -27.59078    4.990802
          -------------+----------------------------------------------------------------
               sigma_u |  4.5369775
               sigma_e |  1.3341949
                   rho |  .92040526   (fraction of variance due to u_i)
          ------------------------------------------------------------------------------
          F test that all u_i=0: F(16, 96) = 22.35                     Prob > F = 0.0000
          
          . estimate store fixed
          
          . xtreg $ylist $xlist, re
          
          Random-effects GLS regression                   Number of obs     =        130
          Group variable: cntryid                         Number of groups  =         17
          
          R-squared:                                      Obs per group:
               Within  = 0.2475                                         min =          3
               Between = 0.9074                                         avg =        7.6
               Overall = 0.8444                                         max =          8
          
                                                          Wald chi2(17)     =     607.60
          corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
          
          ------------------------------------------------------------------------------
                 tincw | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
          -------------+----------------------------------------------------------------
                  hhep |  -.1116863   .1118598    -1.00   0.318    -.3309275    .1075549
                  hhgp |   1.168678   .2655854     4.40   0.000     .6481401    1.689216
                  dipa |   .0720898    .037054     1.95   0.052    -.0005346    .1447143
                  ddpa |   .0392789   .0362982     1.08   0.279    -.0318642    .1104221
                 noren |  -3.542154   2.285047    -1.55   0.121    -8.020763     .936456
                 noown |  -.2928582   2.041896    -0.14   0.886    -4.294901    3.709185
                 povri |   .5071164   .0942246     5.38   0.000     .3224396    .6917933
                  ewmd |    .106643   .0570682     1.87   0.062    -.0052086    .2184946
                  epad |  -.1702194   .0705698    -2.41   0.016    -.3085338   -.0319051
                  epel |  -.0689553   .0248606    -2.77   0.006    -.1176812   -.0202295
                  epop |  -.2736536   .2108813    -1.30   0.194    -.6869733    .1396661
                  epug |   .4909351   .2067978     2.37   0.018     .0856187    .8962514
                 wgswe |  -.3989374   .2502493    -1.59   0.111     -.889417    .0915422
                 wgsst |   .6348091   .3525678     1.80   0.072    -.0562111    1.325829
                  wgge |  -.0935146   .1064199    -0.88   0.380    -.3020937    .1150645
                 wgphs |  -.4297557   .0750673    -5.72   0.000    -.5768849   -.2826264
                   rec |  -.0801897   .0334849    -2.39   0.017    -.1458188   -.0145606
                 _cons |   32.17264   8.239852     3.90   0.000     16.02283    48.32246
          -------------+----------------------------------------------------------------
               sigma_u |          0
               sigma_e |  1.3341949
                   rho |          0   (fraction of variance due to u_i)
          ------------------------------------------------------------------------------
          
          . estimate store random
          
          . hausman fixed random
          
                           ---- Coefficients ----
                       |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
                       |     fixed        random       Difference       Std. err.
          -------------+----------------------------------------------------------------
                  hhep |    .0280269    -.1116863        .1397132        .1576455
                  hhgp |    .4914672     1.168678       -.6772108        .0596249
                  dipa |   -.0745511     .0720898       -.1466409               .
                  ddpa |   -.0081977     .0392789       -.0474766               .
                 noren |    1.659452    -3.542154        5.201605        1.526245
                 noown |   -.7908194    -.2928582       -.4979612        1.873702
                 povri |    .7866492     .5071164        .2795328        .0235842
                  ewmd |   -.0224301      .106643       -.1290731               .
                  epad |   -.1133617    -.1702194        .0568578               .
                  epel |   -.0495486    -.0689553        .0194067        .0193859
                  epop |   -.1073209    -.2736536        .1663327               .
                  epug |    .2627188     .4909351       -.2282163               .
                 wgswe |    .2540827    -.3989374        .6530201        .1419533
                 wgsst |   -.4646673     .6348091       -1.099476               .
                  wgge |   -.0777319    -.0935146        .0157827               .
                 wgphs |    .1234708    -.4297557        .5532265        .0638484
                   rec |   -.0151661    -.0801897        .0650236        .0785485
          ------------------------------------------------------------------------------
                                    b = Consistent under H0 and Ha; obtained from xtreg.
                     B = Inconsistent under Ha, efficient under H0; obtained from xtreg.
          
          Test of H0: Difference in coefficients not systematic
          
             chi2(17) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                      = 103.59
          Prob > chi2 = 0.0000
          (V_b-V_B is not positive definite)
          As the hausman test suggested, i ran the fixed effects model. And then performed some post-tests on this as i read about this on this forum.
          Code:
          . xtserial $ylist $xlist
          
          Wooldridge test for autocorrelation in panel data
          H0: no first order autocorrelation
              F(  1,      16) =      7.774
                     Prob > F =      0.0132
          
          . quietly xtreg $ylist $xlist, fe
          
          . xtcsd, pesaran abs
           
           
          Pesaran's test of cross sectional independence =    -0.433, Pr = 0.6652
           
          Average absolute value of the off-diagonal elements =     0.400
          
          . xttest3
          
          Modified Wald test for groupwise heteroskedasticity
          in fixed effect regression model
          
          H0: sigma(i)^2 = sigma^2 for all i
          
          chi2 (17)  =     826.11
          Prob>chi2 =      0.0000

          As i could observe my data both suffered from autocorrelation and groupwise heteroskedasticity, I ran the xtreg with cluster() as mentioned in "Robust standard errors for panel regressions with cross-sectional dependence" by Daniel Hoechle.
          Code:
          . xtreg $ylist $xlist, fe cluster()
          
          Fixed-effects (within) regression               Number of obs     =        130
          Group variable: cntryid                         Number of groups  =         17
          
          R-squared:                                      Obs per group:
               Within  = 0.5967                                         min =          3
               Between = 0.5160                                         avg =        7.6
               Overall = 0.4947                                         max =          8
          
                                                          F(17,96)          =       8.35
          corr(u_i, Xb) = -0.1052                         Prob > F          =     0.0000
          
          ------------------------------------------------------------------------------
                 tincw | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
          -------------+----------------------------------------------------------------
                  hhep |   .0280269   .1932996     0.14   0.885    -.3556697    .4117235
                  hhgp |   .4914672   .2721962     1.81   0.074    -.0488379    1.031772
                  dipa |  -.0745511   .0314983    -2.37   0.020    -.1370748   -.0120274
                  ddpa |  -.0081977   .0306862    -0.27   0.790    -.0691093    .0527139
                 noren |   1.659452   2.747883     0.60   0.547    -3.795054    7.113957
                 noown |  -.7908194     2.7713    -0.29   0.776    -6.291805    4.710167
                 povri |   .7866492   .0971313     8.10   0.000      .593845    .9794533
                  ewmd |  -.0224301   .0322808    -0.69   0.489    -.0865069    .0416466
                  epad |  -.1133617   .0435624    -2.60   0.011    -.1998324   -.0268909
                  epel |  -.0495486   .0315256    -1.57   0.119    -.1121263    .0130291
                  epop |  -.1073209   .1337802    -0.80   0.424    -.3728724    .1582307
                  epug |   .2627188   .1329301     1.98   0.051    -.0011454    .5265829
                 wgswe |   .2540827   .2877072     0.88   0.379    -.3170116     .825177
                 wgsst |  -.4646673   .3297627    -1.41   0.162    -1.119241    .1899066
                  wgge |  -.0777319   .0663244    -1.17   0.244    -.2093848    .0539211
                 wgphs |   .1234708    .098548     1.25   0.213    -.0721455    .3190872
                   rec |  -.0151661    .085388    -0.18   0.859    -.1846599    .1543277
                 _cons |  -11.29999   8.207012    -1.38   0.172    -27.59078    4.990802
          -------------+----------------------------------------------------------------
               sigma_u |  4.5369775
               sigma_e |  1.3341949
                   rho |  .92040526   (fraction of variance due to u_i)
          ------------------------------------------------------------------------------
          F test that all u_i=0: F(16, 96) = 22.35                     Prob > F = 0.0000
          As you can see, I only get a few significant results on some of my control variables (dipa - dwelling in intermediately populated areas; povri- poverty risk; epad - energy price automotive diesel; energy price - unleaded gasoline, borderline significant).
          I am not sure if I am doing something wrong in my data or if this is just the results, hence why i was curious about what the number of variables included in the xtreg could do to my results.

          Please let me know, if you need more information. I have both been in doubt if i should include i.year when I perform my xtreg and whether this is the right way to go about control variables that might confound with each other as well?

          And apologies for this long response, hope it makes sense and thank you for having a look at it!

          - Anne

          Comment


          • #6
            Anne:
            thanks for abiding by the FAQ.
            As far as your query is concerned:
            1) your -xset- seems correct;
            2) it is not correct to run -.hausman- with deafault standard errors and then impose them. You should investigate the presence of heteroskedasticity and serial and/or across panels correlation before -hausman-. Therefore, while it's correct to impose cluster-robust standard errors to take both heteroskedastcity and autorrelation into account, you should switch from -hausman- to the community-contributed module -xtoverid- (-search xtoverid. from within Stata to spot and install it) to check with specification is the best one for your pane data regression model, as -hausman- deos not support non-default standard errors;
            3) especially with -xtreg,fe- is a good idea to include -i.year- in the right-hand side of your regression equation.
            Kind regards,
            Carlo
            (Stata 18.0 SE)

            Comment


            • #7
              Hi Carlo,
              Thank you for your response, i wasn't aware of my flaw with testing after the hausman test so i greatly appreciate your response!

              When I perform xtoverid in stata I get the following error message: Error - saved RE estimates are degenerate (sigma_u=0) and equivalent to pooled OLS
              I read in a previous thread (sigma_u=0 in random effects model - Statalist), that it might be caused by one of the variables, and found that sigma_u=0 when I include welfare generosity public health spending (wgphs) and rec (consumption of renewables). It would hurt my analysis a bit to exclude the two.
              In the thread I linked to, I could read that the person when removing his faulty variable, the rho was still low - however, mine looks good I think (?)
              I performed the xtoverid on the new xtreg excluding the two variables
              Code:
              . xtreg $ylist hhep hhgp dipa ddpa noren noown povri ewmd epad epel epop epug wgswe wgsst wgge i.year, fe cluster()
              
              Fixed-effects (within) regression               Number of obs     =        130
              Group variable: cntryid                         Number of groups  =         17
              
              R-squared:                                      Obs per group:
                   Within  = 0.6238                                         min =          3
                   Between = 0.5366                                         avg =        7.6
                   Overall = 0.5225                                         max =          8
              
                                                              F(22,91)          =       6.86
              corr(u_i, Xb) = -0.0263                         Prob > F          =     0.0000
              
              ------------------------------------------------------------------------------
                     tincw | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
              -------------+----------------------------------------------------------------
                      hhep |   .0825271   .1990451     0.41   0.679    -.3128517    .4779058
                      hhgp |   .7093138   .2905711     2.44   0.017     .1321301    1.286498
                      dipa |   -.077868   .0320761    -2.43   0.017    -.1415832   -.0141528
                      ddpa |  -.0199812   .0321717    -0.62   0.536    -.0838865     .043924
                     noren |   .7698163   2.898833     0.27   0.791     -4.98836    6.527993
                     noown |   .3374957   2.907585     0.12   0.908    -5.438065    6.113056
                     povri |   .6901674   .0941287     7.33   0.000     .5031923    .8771424
                      ewmd |   -.010719   .0416958    -0.26   0.798    -.0935426    .0721046
                      epad |  -.1314238   .0664569    -1.98   0.051    -.2634323    .0005848
                      epel |  -.0756988   .0343182    -2.21   0.030    -.1438678   -.0075299
                      epop |  -.0928882   .1380903    -0.67   0.503    -.3671875    .1814111
                      epug |   .3574038   .1535379     2.33   0.022     .0524196    .6623881
                     wgswe |   .2504394   .3322971     0.75   0.453    -.4096279    .9105067
                     wgsst |  -.3365769    .353228    -0.95   0.343    -1.038221    .3650671
                      wgge |  -.0707352   .0669977    -1.06   0.294     -.203818    .0623476
                           |
                      year |
                     2008  |  -.2284542   .9580592    -0.24   0.812    -2.131521    1.674613
                     2009  |  -.2159023   .8067717    -0.27   0.790    -1.818455    1.386651
                     2010  |   -.915309   .8247258    -1.11   0.270    -2.553526    .7229075
                     2011  |  -2.514369   1.259642    -2.00   0.049    -5.016494   -.0122451
                     2012  |  -3.410177   1.721717    -1.98   0.051    -6.830157    .0098036
                     2013  |  -2.888527   1.633085    -1.77   0.080     -6.13245    .3553956
                     2014  |  -2.729789   1.450819    -1.88   0.063    -5.611663    .1520857
                           |
                     _cons |  -10.46765   5.312598    -1.97   0.052    -21.02048    .0851698
              -------------+----------------------------------------------------------------
                   sigma_u |  4.4383739
                   sigma_e |  1.3233972
                       rho |  .91835264   (fraction of variance due to u_i)
              ------------------------------------------------------------------------------
              F test that all u_i=0: F(16, 91) = 28.13                     Prob > F = 0.0000
              
              . est store fixed
              
              . xtreg $ylist hhep hhgp dipa ddpa noren noown povri ewmd epad epel epop epug wgswe wgsst wgge, re
              
              Random-effects GLS regression                   Number of obs     =        130
              Group variable: cntryid                         Number of groups  =         17
              
              R-squared:                                      Obs per group:
                   Within  = 0.5874                                         min =          3
                   Between = 0.6246                                         avg =        7.6
                   Overall = 0.6001                                         max =          8
              
                                                              Wald chi2(15)     =     165.25
              corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
              
              ------------------------------------------------------------------------------
                     tincw | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
              -------------+----------------------------------------------------------------
                      hhep |  -.0168247   .1578861    -0.11   0.915    -.3262758    .2926263
                      hhgp |   .4983082    .253358     1.97   0.049     .0017356    .9948807
                      dipa |  -.0629293   .0282748    -2.23   0.026    -.1183468   -.0075117
                      ddpa |   .0005462   .0282073     0.02   0.985    -.0547391    .0558315
                     noren |   1.209543   2.280141     0.53   0.596     -3.25945    5.678537
                     noown |  -1.249435   2.449793    -0.51   0.610    -6.050941    3.552072
                     povri |   .7504647   .0764499     9.82   0.000     .6006257    .9003038
                      ewmd |  -.0162191   .0311648    -0.52   0.603    -.0773009    .0448628
                      epad |  -.1115036   .0418541    -2.66   0.008    -.1935362    -.029471
                      epel |  -.0462431    .026253    -1.76   0.078    -.0976979    .0052118
                      epop |  -.0989915   .1293674    -0.77   0.444    -.3525469     .154564
                      epug |   .2500325   .1254859     1.99   0.046     .0040847    .4959803
                     wgswe |   .2026179   .2509482     0.81   0.419    -.2892315    .6944672
                     wgsst |  -.3751621    .305643    -1.23   0.220    -.9742114    .2238872
                      wgge |  -.0636361   .0633462    -1.00   0.315    -.1877924    .0605203
                     _cons |   -1.14471   3.275348    -0.35   0.727    -7.564274    5.274854
              -------------+----------------------------------------------------------------
                   sigma_u |  4.4425074
                   sigma_e |  1.3312634
                       rho |  .91760037   (fraction of variance due to u_i)
              ------------------------------------------------------------------------------
              
              . est store random
              
              . xtoverid
              
              Test of overidentifying restrictions: fixed vs random effects
              Cross-section time-series model: xtreg re   
              Sargan-Hansen statistic  12.445  Chi-sq(15)   P-value = 0.6450
              I am a bit unsure of what my results mean in this case, i see in the description of xtoverid that the null hypothesis is that the excluded instruments are valid instruments which i am unable to reject - but practically, what does it mean?

              Comment


              • #8
                Anne:
                -xtoverid. outcome tells you to go -xtreg, re-.
                You can find clue of that in -xtoverid. helpfile, section that discusses the compruson of -re- (the null) and -fe- (the alternate) as a test of overidentfying restrictions.
                Last edited by Carlo Lazzaro; 12 Apr 2022, 09:11.
                Kind regards,
                Carlo
                (Stata 18.0 SE)

                Comment


                • #9
                  Thank you very much for your help, I will take a look at it. Hope it's okay that I get back to the thread if I run into new problems.

                  Comment


                  • #10
                    Anne:
                    yes, it is.
                    Kind regards,
                    Carlo
                    (Stata 18.0 SE)

                    Comment


                    • #11
                      Hi Carlo, I am back with some new issues :D

                      I found a way to get a more extensive time period, as I had previously overlooked some available data, so my dataset has changed slightly. Thus, I now have a somewhat larger time period from 2007-2017.
                      I will produce the same outputs as last to give you an initial overview, just in case:
                      Code:
                      * Example generated by -dataex-. For more info, type help dataex
                      clear
                      input int year byte cntry float(bincw tincw hhep hhgp dipa ddpa noren noown povri eptot epad epop wgswe wgsst wgge wgphs) byte dc float(rec gcr ocr ccr ecr hcr rcr)
                      2007  1  9.38  4.13  17.4  6.1 25.2 35.4 1.4 1.7 16.7  85.93  92.33  93.29 25.09 19.4 49.2 74.37 2 29.03  23.22555 20.395636  1.0081159 24.711527   8.450013 22.205816
                      2008  1 11.93  6.15 17.76 6.01 24.5 36.5 1.3 1.7 20.6  95.71  110.5 106.02 25.52 19.6 49.9 74.96 2 29.76  23.48639  20.40695  1.0044297 24.268173   8.637357 22.193394
                      2009  1 11.65   6.2 19.09 6.35 25.4 35.9 1.4 1.8 19.1  89.71  86.85  86.96 27.47 21.2 54.1  75.1 2 31.29 23.490437 18.633514   .7448246 24.449175   8.977472 23.701353
                      2010  1 12.15   6.7 19.49 6.12   25 35.8 1.4 1.8 18.9  96.81  98.64 100.73 27.56 21.4 52.8 74.65 2 31.13  23.57059 19.024532   .7526115  23.09149   9.330699 24.226913
                      2011  1 12.38  5.83 19.76 7.08 25.4 36.6 1.4 1.8 19.2 105.57 118.67 117.36 26.74 20.7 50.9 74.61 2 31.64 22.565424  17.80501   .4971629 24.402155   9.786998 24.939806
                      2012  1 10.48   5.5  19.5 7.61 28.1 30.2 1.4 1.8 18.5 110.59  125.8  125.5 27.11 20.9 51.2 74.68 2 34.28  22.61912  16.47214   .5034489 24.117697  10.415233  25.86904
                      2013  1  12.5  5.63  20.5 7.61 29.5 29.7 1.4 1.7 18.8 110.32 121.06 120.34 27.52 21.3 51.6 74.01 2  34.7 21.627825  15.71511   .3932869  22.14183  11.863143  28.25569
                      2014  1   9.2  4.98 20.04 7.39 29.4 29.8 1.3 1.7 19.2  107.2 115.95 115.41 27.73 21.5 52.4 74.01 2 35.79  21.21227 15.412713   .3686959  24.30238  11.299107 27.401283
                      2015  1 10.85   5.1 19.96 7.21 30.1 29.9 1.3 1.8 18.3    100    100    100 27.74 21.2 51.1 74.06 2 34.88 21.683344 15.606082  .28485712  23.15494  11.703347 27.564137
                      2016  1 11.25   5.2 20.22 6.82 29.6 30.1 1.3 1.8   18  95.97   91.9  90.82 27.72   21 50.1 73.96 2 34.61  22.07724 15.520995  .27891415 22.616787  11.916186  27.58989
                      2017  1 11.75  5.08 19.64 6.87 30.3 30.6 1.3 1.8 18.1  98.14  98.64  97.58 27.26 20.6 49.3 74.02 2 33.96  21.97039   15.8495  .27847612  22.54122  11.797644 27.562754
                      2007  2 25.33 12.03 16.83    5 42.5 53.5   2 2.2 21.6  85.31  89.39  98.39 24.98 16.8 48.6 73.97 1  3.34  39.41136   32.3906  1.0942321  22.58899  .17656232 4.3382716
                      2008  2 18.53  8.98 20.62 6.57 42.7   53   2 2.2 20.8 102.95 102.33 115.36 26.47 17.5 50.8 75.54 1  3.91  36.69792 37.938927  1.4350085 19.111605   .1546265  4.661909
                      2009  2 17.63  7.83  18.9 5.61 42.1 53.8 2.1 2.3 20.2  87.12  83.43   89.7 28.76 19.2 54.7 76.09 1  4.83  38.80354 33.091167    2.46416 20.354927  .14660493  5.139606
                      2010  2    20     9 19.67 5.67 41.5 54.3   2 2.2 20.8  94.42  98.22 105.75 28.45 18.9 53.9 76.07 1  5.82  41.83622 32.886734  1.1185629 18.298855  .11681983  5.742823
                      2011  2  22.2 10.35 21.28 6.83 41.4 54.3 2.1 2.3   21 109.05  117.7 124.82 28.89 19.1 55.3 76.13 1  6.63  38.98323 33.042038  1.2313198  20.73156   .1617904  5.850071
                      2012  2 19.65   9.5 22.75 7.12   52   30 2.1 2.3 21.6  115.1 125.18 135.19  28.8 19.6 56.5 76.59 1  7.76  39.81797 31.316317  1.1497375 20.412014  .07826941  7.225688
                      2013  2 19.28  8.68 21.94 6.64 53.1 29.4 2.1 2.3 20.8 111.38 120.63 129.86  29.2 20.1 56.1 76.15 1  8.09  41.05736 31.490515   1.384388  18.77888  .04581846  7.243032
                      2014  2 19.63  8.53  20.7 6.54 53.2 28.8 2.1 2.2 21.2 105.59 115.71 121.11 29.11 19.8 55.6 76.36 1  9.12  39.00589  31.26771  1.1056286 21.777443  .05340703  6.789936
                      2015  2 19.78  8.43 22.39 6.03 52.8 29.1 2.1 2.3 21.1    100    100    100 29.52 19.4 53.7 75.94 1  9.38  38.83195 33.158264  1.1430725 19.595497 .023987735  7.247225
                      2016  2 20.23  8.45 26.45 5.41   54 28.1   2 2.2 20.9 101.49  97.02  89.93 28.85 19.4 53.1 77.26 1  9.21  40.94687 30.284184  1.0148362  19.48147 .010659258  8.261998
                      2017  2 20.15  8.53 28.38 5.36 54.6 27.4 1.9 2.2 20.6 108.11 108.51  99.21 28.72 19.3   52 77.35 1  9.64  40.82359 30.988714   .9711155  19.19027  .01105012  8.015184
                      2007  5 19.85   7.9  11.6 3.62 23.7 34.9   1 1.3 15.8  83.17  92.04  94.11 17.43 12.1 40.4 84.69 2  8.32  31.73323  .3921629  10.007526   19.6273  17.728952  20.51083
                      2008  5 17.48   7.1 14.15 4.84 24.7 34.8   1 1.3 15.3  90.26 101.77  96.74 17.72 12.2 40.9  82.1 2  8.99  31.42914 .27316406   9.902892   19.4067  17.588236  21.39985
                      2009  5 16.33  7.25 14.94 4.84 23.8 35.3   1 1.4   14  90.44  84.05  86.95    20 13.4 44.4 83.27 2 10.25 30.927687 .09430304   10.86059 18.966566  16.736694  22.41416
                      2010  5 15.03   6.6 15.23 4.93 24.6 35.5 1.1 1.4 14.4   94.8  98.42 101.62 19.57 13.5 43.6 83.33 2 10.95  32.01096  .3234589  12.777144  17.36242  16.621796  20.90422
                      2011  5 16.08  7.25 16.43  5.7 24.6 35.2 1.1 1.4 15.3 102.94 109.84 110.37 19.62 13.5 43.2 83.88 2 12.16  29.17096  .4573459  12.951976 17.787163   16.17372 23.458824
                      2012  5  17.5     7 16.66  6.6   31 30.2 1.1 1.5 15.4 110.59 116.86 117.05 19.83 13.7 44.7 83.74 2  12.8  28.45086  .6178253  13.187037 17.629211  16.451874 23.663197
                      2013  5  17.1   6.6 16.63 6.08 32.8 29.9 1.1 1.5 14.6 109.98 115.83  115.4 20.68 13.8 42.7 83.61 2 13.96 27.960726  .5331555  13.464274 17.429077  16.449474 24.163265
                      2014  5  17.7  6.53 13.84 5.56 31.2 31.5 1.1 1.5 14.8 105.53 116.31 115.23 20.07 13.4 42.6 82.69 2 14.86  25.13905  .6874444    12.6856 18.560434  15.374326 27.553144
                      2015  5  14.3  5.48 13.97 5.79 32.8 30.3 1.1 1.5   14    100    100    100 19.27 12.9 41.9 82.37 2 14.85  26.48091  .6657068  12.290433  18.30056  15.038042 27.224337
                      2016  5 12.83   4.7 14.21 5.73 32.3 30.2 1.1 1.5 13.3   96.2  87.76  91.21 18.89 12.7 39.8 81.98 2 14.78 28.174265  .6357044  11.588123 18.147747  14.936806  26.51734
                      2017  5 10.63  4.08 14.63 5.58 34.6 30.1 1.2 1.5 12.2  97.87  94.55  96.69 18.55 12.3   39 82.09 2 14.47  27.89005  .6259038  11.654857 18.198517   14.83082  26.79985
                      2007  6 14.43  6.95 20.65 6.13 34.5 50.7 1.6 1.9 20.6  85.67  98.35  96.33 24.21 18.9 43.4 74.92 2 10.47  38.70176  20.65273   1.317827 22.125376  8.0620575  9.140249
                      2008  6 16.78  7.43 21.72 7.02 34.5 50.6 1.6 1.9 20.1  93.17  112.1 106.48 24.35 18.8 44.2 75.05 2 10.25 36.572247  26.62609  1.0752764  19.79081    7.27728  8.658301
                      2009  6 16.58  7.15 22.88 6.19 35.3 49.7 1.6 1.9   20  87.45   91.7  91.63  26.8 20.7 48.2 83.34 2 10.72  37.33253 24.080725    1.08467  20.45085   7.200607  9.850622
                      2010  6 15.63   6.7 24.07 5.68 36.1 48.9 1.6 1.9 19.7  91.68 103.16 102.82 26.05 20.1 48.1 83.24 2 11.61   38.2658  22.94968  1.5880527  19.50209   7.221112 10.473257
                      2011  6 17.43     7  25.3 6.14 36.7 48.6 1.6 1.9 19.9  99.73 119.89 116.47 24.75 18.9 45.2 83.11 2 12.54 36.201603 22.658813   1.586333   21.5207   7.192253 10.840303
                      2012  6  14.8  6.58 26.36 6.43 39.6 35.3 1.6 1.9 19.6 105.09 125.36 124.73 24.65 18.9 44.9 82.98 2 13.64  38.17933  23.00872  1.3118844  20.80359   5.962346 10.734136
                      2013  6 15.28  6.83  29.2 6.75 41.1 34.8 1.6 1.9 20.3 107.65 120.25  120.2 24.83   19 44.9 83.84 2 13.63 37.696846 23.795984  1.1582955 19.584124   7.379486 10.385265
                      2014  6 14.05  6.58 29.78  6.8 41.4 35.4 1.6 1.9 20.6 106.17 114.66 113.74 24.77 18.8 44.3 84.21 2 14.02 35.512333  23.96168  1.1116024   21.6271   7.108074 10.679215
                      2015  6  13.8  6.25 29.49 6.79 41.8 35.8 1.6 1.9   20    100    100    100    25 19.1 44.1 84.18 2 14.55   37.1238  22.04626  1.1299255 20.812754   7.654703  11.23256
                      2016  6  13.5  5.88 29.73 6.52 40.8 36.1 1.6 1.9 19.7  96.28   92.5   91.1 25.25 19.5 44.4 84.32 2 14.24  39.42286  20.57042   .9271631 19.578287   7.886722  11.61455
                      2017  6 12.08  5.48 30.48  6.1 40.4 36.6 1.6   2   19  99.18  99.29  97.66 25.37 19.4 44.2 84.53 2 15.22  38.19159  20.06627   .8848022 19.492075   7.835474 13.529788
                      2007  7    14  8.25 24.01  8.5 41.7 33.3 1.8 1.9 16.8  89.46  88.42  87.15 25.91 21.5 49.6 83.71 2 17.68  13.86752 11.427213          0  19.70684   32.76115 22.049236
                      2008  7  6.95  3.58  27.1 9.69 41.3 33.3 1.8 1.9 16.3   96.6  101.8     93 26.32 21.6 50.4 84.02 2 18.53 13.886897 10.708405 .009711055 19.642576   33.79596 21.767275
                      2009  7   5.4  3.35 26.27 8.27 41.4 33.6 1.8   2 17.6  89.56  83.77  84.52 29.28 24.3 56.5 84.46 2 19.32 13.925094 10.106245 .009691102 19.251364  34.679955  21.81312
                      2010  7  7.98  3.75 26.89  9.6 41.9 33.4 1.8   2 18.3  98.33  96.51  96.95 29.64 24.8 56.7 83.88 2 21.18 14.800093  9.516583 .008732644 17.850822  36.578526  21.03346
                      2011  7 10.63  6.08 29.42 10.3 39.9 33.6 1.8 1.9 17.6 108.21 112.07 108.44 29.78 24.7 56.4 83.61 2 23.81  14.20326  8.911214 .009719974  19.33741  35.851624 21.447266
                      2012  7  12.1  6.53 29.85 9.68 21.7 33.7 1.9   2 17.5 110.99 118.63 115.03 29.93 24.6   58 83.98 2 26.91  14.43431  7.609967 .009832406  19.32504   37.10734  21.32586
                      2013  7  13.2  6.95 29.68 9.85 20.3 34.2 1.8   2 18.3 108.88 121.29 115.84 29.89 24.5 55.8 84.26 2  27.1 14.285147  7.111837 .009747467    19.768   36.71273 21.901087
                      2014  7   9.6  6.35 30.39 8.93 20.6 34.2 1.9   2 17.9  106.1  114.6 110.45 29.88   24 55.2 84.19 2 30.23 13.422942  5.639378          0  20.95508  36.426983  23.32076
                      2015  7 14.78  6.68 30.55 7.83 20.5 34.2 1.8   2 17.7    100    100    100 29.87 23.5 54.5 84.18 2 32.98 13.160286  5.406931          0 19.694605  36.463696 25.050444
                      2016  7 10.23  5.95 30.86 7.29 34.9 31.9 1.8   2 16.8  98.79  92.75  93.66 29.31 22.9 52.5 84.12 2 32.13 13.328979  5.040223 .003656468  19.26852  36.201275  25.91835
                      2017  7  11.4  5.95  30.3 8.42 34.6 32.3 1.7   2 17.2 101.41  99.34 100.04 29.16 22.2 50.5 84.02 2 35.51  12.79836  4.743867          0 18.660427   36.81436 26.797646
                      2007  8  15.8  8.38  7.86 2.63  2.6 46.2  .9 1.2   22  72.86  80.43   79.6 12.37    9 33.7 75.92 2 18.55  5.080664  .8757363   .6744272 15.852159  37.685673  39.39431
                      2008  8    12  6.68  8.32 3.53  2.9 46.1   1 1.2 21.8  84.18 106.26  94.62 15.12 11.3 39.5 76.98 2 20.24  5.163007 1.1109046   .6130034 16.660522  35.064487  40.78599
                      2009  8 13.93   8.4  9.21 3.79  3.6 45.9   1 1.2 23.4  79.28  84.03  83.36 19.31   15 45.9 77.87 2 24.08  5.222933  .8568472   .4681115 16.699345  34.081116  42.39589
                      2010  8 17.63     9  9.87 3.82  3.4 45.7   1 1.2 21.7  91.12 102.53 100.72 17.99 13.8 40.3 76.33 2 25.39   5.34655  .8127778  .50542974  16.93988  34.824986  41.23547
                      2011  8 17.58  9.25 10.08 4.28    3 45.7 1.4 1.6 23.1   98.9 117.65 112.56 16.04 12.2 37.4 76.69 2 25.09  5.525457  1.000371   .6958545 17.780643   35.56952  38.97876
                      2012  8 17.38  9.68  11.1 5.09 16.9   42 1.4 1.6 23.4 108.61  127.3 123.52 15.64   12 39.2 76.65 2 25.02  5.699362  .8561764   .6032994 17.323975   35.01156  40.09433
                      2013  8 13.58  8.43 13.59    5 17.1 42.1 1.3 1.5 23.5 113.38  122.7 119.06 15.58 11.6 38.4 75.61 2 24.55  5.600286  .7822124   .6251701 17.178358  35.359707  40.02663
                      2014  8 11.93  7.33 13.16 4.93 15.7 43.1 1.3 1.7   26 109.92 117.44 115.18 15.95 11.5 37.8 75.68 2 25.49  5.879008  .9444425    .511179 16.835915  33.594364  41.82626
                      2015  8  11.5  6.33 12.97  4.2 15.1 43.8 1.3 1.7 24.2    100    100    100 17.15 12.5 39.5 75.62 2 27.56  5.751106 1.1050401   .3025302 17.328545    33.0621  42.15422
                      2016  8  11.4   6.8 12.23 3.37 15.2   44 1.4 1.7 24.4  94.32  95.94  96.07 17.51 12.8 39.4 75.66 2 26.91  6.218501 1.1431605   .2090099 17.675896   33.51261  41.24082
                      2017  8  11.8   6.5 12.63 4.16 15.3 43.9 1.4 1.7 23.4 102.74 109.09 107.58 17.24 12.6 39.2 73.59 2 27.03  5.877591 1.0215439  .22302505 17.698767  33.755405  41.42388
                      end
                      Code:
                      sum
                      
                          Variable    Obs    Mean    Std. dev.    Min    Max
                                              
                          year    242    2012    3.168832    2007    2017
                          cntry    242    14.27273    7.638622    1    27
                          bincw    242    20.40496    10.30543    5.4    47.58
                          tincw    242    10.8007    6.466974    2.98    29.2
                          hhep    241    17.42664    5.016967    7.29    30.86
                                              
                          hhgp    226    6.239469    1.906045    2.35    12.26
                          dipa    237    27.6308    11.36708    .8    54.6
                          ddpa    242    37.58802    10.31794    13    66.1
                          noren    242    1.345455    .3944638    .6    2.3
                          noown    242    1.650826    .3823103    1    2.3
                                              
                          povri    242    22.68058    5.998838    12.2    40.1
                          eptot    242    96.93992    10.64845    66.06    122.27
                          epad    242    103.1803    13.17705    73.64    130.26
                          epop    242    102.0201    12.28347    71.03    135.19
                          wgswe    242    22.82558    4.769228    11.08    32.03
                                              
                          wgsst    242    17.52603    3.756922    7.9    25.5
                          wgge    242    46.65702    6.510901    26.2    64.9
                          wgphs    242    74.73178    7.258142    55.87    87.33
                          dc    242    1.5    .893731    0    3
                          rec    242    18.95603    11.96193    3.34    52.89
                                              
                          gcr    242    24.99163    19.51676    .3802139    77.83798
                          ocr    242    13.65882    13.29408    .094303    49.49794
                          ccr    242    2.990839    7.282563    0    35.87513
                          ecr    242    23.84931    10.17473    10.58211    51.69038
                          hcr    242    13.93679    13.24902    0    40.24403
                                              
                          rcr    242    20.49344    13.06915    .7375578    52.39993
                      My first question regards the random effects model:
                      (1): Are there any other tests I should perform besides the Breusch and Pagan Lagrangian multiplier test for random effects on this kind of model before doing my Hausman test as there is with the fixed effects model?

                      Code:
                      . xtreg tincw dipa ddpa noren noown povri wgswe wgsst wgge wgphs rec epad hhgp hhep epad epop, re
                      note: epad omitted because of collinearity.
                      
                      Random-effects GLS regression                   Number of obs     =        220
                      Group variable: cntry                           Number of groups  =         21
                      
                      R-squared:                                      Obs per group:
                           Within  = 0.6009                                         min =          6
                           Between = 0.6740                                         avg =       10.5
                           Overall = 0.6322                                         max =         11
                      
                                                                      Wald chi2(14)     =     319.08
                      corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
                      
                      ------------------------------------------------------------------------------
                             tincw | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
                      -------------+----------------------------------------------------------------
                              dipa |  -.0392455   .0176258    -2.23   0.026    -.0737915   -.0046996
                              ddpa |   .0063827   .0171118     0.37   0.709    -.0271557    .0399212
                             noren |   -.738471   1.540009    -0.48   0.632    -3.756832     2.27989
                             noown |  -1.935602   1.678005    -1.15   0.249    -5.224431    1.353227
                             povri |   .7672141   .0519291    14.77   0.000     .6654349    .8689932
                             wgswe |   .2051212   .1863756     1.10   0.271    -.1601682    .5704107
                             wgsst |  -.4157811   .2131102    -1.95   0.051    -.8334694    .0019073
                              wgge |  -.0286019   .0484703    -0.59   0.555    -.1236019    .0663981
                             wgphs |    .054728   .0482755     1.13   0.257    -.0398903    .1493463
                               rec |  -.0161759   .0357048    -0.45   0.651     -.086156    .0538042
                              epad |  -.0628722   .0263954    -2.38   0.017    -.1146063   -.0111381
                              hhgp |   .1789633   .1438991     1.24   0.214    -.1030737    .4610002
                              hhep |  -.0303706   .0580303    -0.52   0.601    -.1441079    .0833666
                              epad |          0  (omitted)
                              epop |    .079994   .0302316     2.65   0.008     .0207412    .1392467
                             _cons |  -3.495252   4.364361    -0.80   0.423    -12.04924    5.058739
                      -------------+----------------------------------------------------------------
                           sigma_u |  3.9200088
                           sigma_e |  1.2617715
                               rho |  .90612001   (fraction of variance due to u_i)
                      ------------------------------------------------------------------------------
                      
                      . xttest0
                      
                      Breusch and Pagan Lagrangian multiplier test for random effects
                      
                              tincw[cntry,t] = Xb + u[cntry] + e[cntry,t]
                      
                              Estimated results:
                                               |       Var     SD = sqrt(Var)
                                      ---------+-----------------------------
                                         tincw |   40.23271       6.342926
                                             e |   1.592067       1.261771
                                             u |   15.36647       3.920009
                      
                              Test: Var(u) = 0
                                                   chibar2(01) =   346.47
                                                Prob > chibar2 =   0.0000
                      Again, just in case, below i've copied my tests on fixed effects and the result of the community contributed robust Hausman test xtoverid by Mark E Schaffer & Steven Stillman (2010).


                      Code:
                      xtreg tincw dipa ddpa noren noown povri wgswe wgsst wgge wgphs rec hhgp hhep epad    epop    i.year,    fe
                      
                      Fixed-effects (within) regression               Number of obs     =        220
                      Group variable: cntry                           Number of groups  =         21
                      
                      R-squared:                                      Obs per group:
                      Within  = 0.6302                                         min =          6
                      Between = 0.5214                                         avg =       10.5
                      Overall = 0.4915                                         max =         11
                      
                      F(24,175)         =      12.43
                      corr(u_i, Xb) = -0.0296                         Prob > F          =     0.0000
                      
                      
                      tincw  Coefficient  Std. err.      t    P>t     [95% conf. interval]
                      
                      dipa    -.036817      .0186    -1.98   0.049    -.0735262   -.0001077
                      ddpa   -.0090984   .0200867    -0.45   0.651    -.0487419     .030545
                      noren   -1.370826   1.696216    -0.81   0.420    -4.718498    1.976847
                      noown    .4609595   1.879974     0.25   0.807     -3.24938    4.171299
                      povri    .7192726   .0563931    12.75   0.000     .6079744    .8305707
                      wgswe    .2981975   .2082641     1.43   0.154    -.1128351    .7092302
                      wgsst   -.4727493   .2299917    -2.06   0.041    -.9266638   -.0188347
                      wgge   -.0624191   .0514873    -1.21   0.227     -.164035    .0391968
                      wgphs    .1106438   .0526128     2.10   0.037     .0068066     .214481
                      rec    .0991194   .0580104     1.71   0.089    -.0153708    .2136095
                      hhgp    .2474524   .1686136     1.47   0.144    -.0853255    .5802303
                      hhep   -.0051598   .0614677    -0.08   0.933    -.1264733    .1161537
                      epad   -.0374935   .0334188    -1.12   0.263    -.1034493    .0284623
                      epop    .0650862   .0369807     1.76   0.080    -.0078995    .1380718
                      
                      year 
                      2008    -.8931288   .6070067    -1.47   0.143    -2.091125    .3048672
                      2009    -.9229855   .5476195    -1.69   0.094    -2.003774    .1578032
                      2010    -.7910677   .6125346    -1.29   0.198    -1.999974    .4178383
                      2011     -1.57604   .9059493    -1.74   0.084    -3.364032    .2119533
                      2012    -1.766482    1.21608    -1.45   0.148    -4.166554     .633589
                      2013    -1.721908    1.17242    -1.47   0.144     -4.03581     .591995
                      2014    -1.839581   1.088597    -1.69   0.093    -3.988049    .3088872
                      2015    -1.838962   .8266178    -2.22   0.027    -3.470385   -.2075388
                      2016    -1.861555    .737822    -2.52   0.013    -3.317729   -.4053801
                      2017    -2.473105   .8276078    -2.99   0.003    -4.106482   -.8397274
                      
                      _cons   -11.62313    5.80563    -2.00   0.047    -23.08119   -.1650633
                      
                      sigma_u   4.6806048
                      sigma_e   1.2522541
                      rho   .93320298   (fraction of variance due to u_i)
                      
                      F test that all u_i=0: F(20, 175) = 46.01                    Prob > F = 0.0000
                      
                      . xttest3
                      
                      Modified Wald test for groupwise heteroskedasticity
                      in fixed effect regression model
                      
                      H0: sigma(i)^2 = sigma^2 for all i
                      
                      chi2 (21)  =     372.36
                      Prob>chi2 =      0.0000
                      
                      xtserial tincw dipa ddpa noren noown povri wgswe wgsst wgge wgphs rec hhgp hhep epad epop
                      
                      Wooldridge test for autocorrelation in panel data
                      H0: no first order autocorrelation
                          F(  1,      20) =     14.880
                                 Prob > F =      0.0010
                      
                      quietly xtreg tincw dipa ddpa noren noown povri wgswe wgsst wgge wgphs rec hhgp hhep epad epop i.year, fe
                      
                      xtcsd, pesaran abs
                       
                       
                      Pesaran's test of cross sectional independence =    -2.051, Pr = 0.0403
                       
                      Average absolute value of the off-diagonal elements =     0.388
                      As last, i can conclude my data both has autocorrelation AR(1) and heteroskedasticity as last time.


                      Code:
                      . quietly xtreg tincw dipa ddpa noren noown povri wgswe wgsst wgge wgphs rec epad hhgp hhep epop, re
                      
                      . xtoverid
                      
                      Test of overidentifying restrictions: fixed vs random effects
                      Cross-section time-series model: xtreg re   
                      Sargan-Hansen statistic  14.219  Chi-sq(14)   P-value = 0.4335
                      As last, the results tells me to go with the random effects model.

                      Last we spoke about me using an xtreg with cluster() as explained by previously mentioned Daniel Hoechle to accommodate the complications shown in my data after the tests when looking at the fe model.
                      (2) Should i also apply this to the re model - this probably relates to my first question regarding more tests to run on random effects models.

                      On another note, i ran into some different youtube videos, which led me to the stata manual on xtgls (xtxtgls.pdf (stata.com)). As i am reading it, i could maybe perform an xtgls ylist xlist, panel(heteroskedastic).
                      (3) Do you think this could be a plausible solution, i get way better results using xtgls, but dont want to use it if it is methodologically wrong. I am a bit in doubt of this since i have no presence of cross-section correlation per the tests displayed above, but i read in the maunal that when applying panel(heteroskedastic), its not taking cross-section correlation into account.

                      Results from xtgls:
                      Code:
                      xtgls tincw dipa ddpa noren noown povri wgswe wgsst wgge wgphs rec epad hhgp hhep epop, panel(heteroskedastic)
                      
                      Cross-sectional time-series FGLS regression
                      
                      Coefficients:  generalized least squares
                      Panels:        heteroskedastic
                      Correlation:   no autocorrelation
                      
                      Estimated covariances      =        21          Number of obs     =        220
                      Estimated autocorrelations =         0          Number of groups  =         21
                      Estimated coefficients     =        15          Obs per group:
                                                                                    min =          6
                                                                                    avg =   10.47619
                                                                                    max =         11
                                                                      Wald chi2(14)     =    1090.94
                                                                      Prob > chi2       =     0.0000
                      
                      ------------------------------------------------------------------------------
                             tincw | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
                      -------------+----------------------------------------------------------------
                              dipa |  -.0011577   .0184459    -0.06   0.950     -.037311    .0349956
                              ddpa |  -.0112832   .0161919    -0.70   0.486    -.0430187    .0204523
                             noren |   1.277538   1.115021     1.15   0.252    -.9078631     3.46294
                             noown |  -5.726547   1.168278    -4.90   0.000    -8.016331   -3.436763
                             povri |   .4950312   .0526464     9.40   0.000     .3918462    .5982163
                             wgswe |   .2374913   .1230344     1.93   0.054    -.0036517    .4786343
                             wgsst |  -.1309246   .1315063    -1.00   0.319    -.3886721     .126823
                              wgge |  -.0093227   .0628512    -0.15   0.882    -.1325088    .1138634
                             wgphs |  -.2632611   .0421939    -6.24   0.000    -.3459597   -.1805626
                               rec |  -.1121734   .0179515    -6.25   0.000    -.1473577    -.076989
                              epad |   -.033142   .0318757    -1.04   0.298    -.0956173    .0293333
                              hhgp |   .4942622   .1229442     4.02   0.000     .2532961    .7352283
                              hhep |   .0109311   .0455445     0.24   0.810    -.0783344    .1001966
                              epop |   .0361175   .0344903     1.05   0.295    -.0314822    .1037172
                             _cons |    22.8291   4.590343     4.97   0.000     13.83219    31.82601
                      ------------------------------------------------------------------------------

                      And, to my final question - so sorry to spam you with all of this - i had to exclude 3 countries due to so much missing data in those 3 countries. I was thinking of still testing them seperately from this batch of countries, on the available variables. However, is 3 countries (52 obs in total) too little to work when using these kinds of models. I have had no significant results from the three so i thought it might be an issue of too little data?


                      Hope you can shed some light on some of my issues yet again!

                      BR Anne

                      Comment


                      • #12
                        Anne:
                        1) as you have a short panel (N>T), stick with -xtreg, re vce(cluster idcode) and forget -xtgls-.
                        As you know, both -robust- and -vce(cluster clusterid)- standard error option take both heteroskedasticity and autocorrelation into account;
                        2) no need to search for other tests, as the outcome of the community-contributed module -xtoverid- points you clearly towards the -re- specification (BTW: with non-default standard errors, you can safey forget -hausman-);
                        3) I would not exclude myself the three countries you mention, because Stata applies listwise deletion by default (ie, they're automatically ruled out from your regression code).
                        Kind regards,
                        Carlo
                        (Stata 18.0 SE)

                        Comment


                        • #13
                          Carlo:
                          Thank you yet again for your help - it works perfectly fine!
                          I had thought to include a dummy variable where the countries are grouped into four different groups according to climate zone. I have tried to add it with an i. and also tried to add it as my id in the xtset option after rearranging the data. The latter option gives me a sigma_u=0 and rho=0. I looked through the forum and saw some have had the same issue, I have thus checked my dataset to see if I had extra rows included from excel that would create missing variables. After having removed those I still have the same issue. Is it too few groups and would you recommend me just running it as with the i.? I am just a bit apprehensive about it, since it is a difficult thing to list in a perfect order, so I am worried it won't be meaningful. The issue with the meaningfulness would probably be an issue no matter which of the two options I chose, but i just thought i would run it by you, just in case you have some good inputs to which way i should chose to do this?

                          Code:
                          sum
                          
                              Variable |        Obs        Mean    Std. dev.       Min        Max
                          -------------+---------------------------------------------------------
                                  year |         44        2012    3.198837       2007       2017
                                    dc |         44         2.5     1.13096          1          4
                                 bincw |         44    19.29182     9.00865       6.08      34.21
                                 tincw |         44    10.61432    5.511808       3.13      20.28
                                  hhep |         44    15.21614    3.931078       6.24      20.33
                          -------------+---------------------------------------------------------
                                  hhgp |         44    7.050682     2.50455       4.31      12.26
                                  dipa |         44    27.81591    6.506897       14.9      36.45
                                  ddpa |         44    37.53977    7.601973      23.25       48.9
                                 noren |         44    1.432955    .2444793       1.04       1.82
                                 noown |         44    1.753864    .2694198        1.3        2.1
                          -------------+---------------------------------------------------------
                                 povri |         44    22.03932    4.202019      15.65      30.25
                                  epad |         44    102.5293    12.42466      80.76     124.02
                                  epel |         44    92.46114    10.98931      63.18     106.35
                                 eplfo |         44    106.8518    18.25087      78.88     140.83
                                  epng |         44    80.53068    22.17318      39.14     111.25
                          -------------+---------------------------------------------------------
                                  epop |         44    101.8343    11.23656      80.13      122.8
                                 eptot |         44    96.69932    9.654911      73.75     111.08
                                  epug |         44    100.8861    10.42345      79.22     119.31
                                 wgswe |         44    22.92364    4.176442         15      28.52
                                 wgsst |         44    16.89727    3.039919      13.34      23.05
                          -------------+---------------------------------------------------------
                                  wgge |         44    44.51341    5.524516      36.12       54.2
                                 wgphs |         44    69.95568    6.232086       64.4      81.21
                                   rec |         44    21.02886    13.79211       4.25      48.67
                          
                          . xtset dc year
                          
                          Panel variable: dc (strongly balanced)
                           Time variable: year, 2007 to 2017
                                   Delta: 1 unit
                          
                          xtreg tincw povri dipa ddpa noren noown wgswe wgge wgphs wgsst rec hhep hhgp epop epad, re vce(robust)
                          
                          Random-effects GLS regression                   Number of obs     =         44
                          Group variable: dc                              Number of groups  =          4
                          
                          R-squared:                                      Obs per group:
                               Within  = 0.8242                                         min =         11
                               Between = 1.0000                                         avg =       11.0
                               Overall = 0.9917                                         max =         11
                          
                                                                          Wald chi2(3)      =          .
                          corr(u_i, X) = 0 (assumed)                      Prob > chi2       =          .
                          
                                                               (Std. err. adjusted for 4 clusters in dc)
                          ------------------------------------------------------------------------------
                                       |               Robust
                                 tincw | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
                          -------------+----------------------------------------------------------------
                                 povri |   .7945952   .1738942     4.57   0.000     .4537688    1.135422
                                  dipa |  -.0095748   .0394767    -0.24   0.808    -.0869477     .067798
                                  ddpa |   .0044669   .0422884     0.11   0.916    -.0784168    .0873506
                                 noren |  -1.252093   5.567381    -0.22   0.822    -12.16396    9.659774
                                 noown |  -5.699108   5.256033    -1.08   0.278    -16.00074    4.602527
                                 wgswe |   -.146217   .1816426    -0.80   0.421      -.50223    .2097961
                                  wgge |   .2447543     .22556     1.09   0.278    -.1973352    .6868438
                                 wgphs |   .0110702   .3804342     0.03   0.977    -.7345671    .7567075
                                 wgsst |  -.4529311   .3681628    -1.23   0.219    -1.174517    .2686547
                                   rec |  -.0952029   .1446041    -0.66   0.510    -.3786216    .1882159
                                  hhep |   .1277079   .1482868     0.86   0.389    -.1629288    .4183447
                                  hhgp |   .4353815   .2975463     1.46   0.143    -.1477986    1.018562
                                  epop |   .0180998   .0848851     0.21   0.831    -.1482719    .1844714
                                  epad |  -.0220373   .0774462    -0.28   0.776    -.1738289    .1297544
                                 _cons |   1.731472   29.16066     0.06   0.953    -55.42238    58.88532
                          -------------+----------------------------------------------------------------
                               sigma_u |          0
                               sigma_e |  .58232569
                                   rho |          0   (fraction of variance due to u_i)
                          ------------------------------------------------------------------------------
                          when including climate zone as i.dc:
                          Code:
                          xtreg tincw povri dipa ddpa noren noown wgswe wgge wgphs wgsst rec hhep hhgp epop epad i.dc, re vce(robust)
                          
                          Random-effects GLS regression                   Number of obs     =        220
                          Group variable: cntry                           Number of groups  =         21
                          
                          R-squared:                                      Obs per group:
                               Within  = 0.6025                                         min =          6
                               Between = 0.7360                                         avg =       10.5
                               Overall = 0.6942                                         max =         11
                          
                                                                          Wald chi2(17)     =    1413.72
                          corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
                          
                                                           (Std. err. adjusted for 21 clusters in cntry)
                          ------------------------------------------------------------------------------
                                       |               Robust
                                 tincw | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
                          -------------+----------------------------------------------------------------
                                 povri |   .7602694   .1169691     6.50   0.000     .5310141    .9895246
                                  dipa |  -.0422104   .0177573    -2.38   0.017    -.0770141   -.0074068
                                  ddpa |    .004894   .0166294     0.29   0.769    -.0276991     .037487
                                 noren |   -.985936    1.81294    -0.54   0.587    -4.539234    2.567361
                                 noown |  -1.568028   2.505599    -0.63   0.531    -6.478912    3.342855
                                 wgswe |   .1636614   .1562385     1.05   0.295    -.1425604    .4698832
                                  wgge |  -.0287188   .0394154    -0.73   0.466    -.1059715    .0485339
                                 wgphs |   .0772432    .054414     1.42   0.156    -.0294062    .1838927
                                 wgsst |   -.385553   .2478628    -1.56   0.120    -.8713552    .1002492
                                   rec |  -.0071723   .0379036    -0.19   0.850     -.081462    .0671175
                                  hhep |  -.0409066      .0716    -0.57   0.568      -.18124    .0994269
                                  hhgp |   .1787298   .1385794     1.29   0.197    -.0928809    .4503405
                                  epop |   .0809009   .0358393     2.26   0.024     .0106571    .1511447
                                  epad |  -.0628535   .0357465    -1.76   0.079    -.1329153    .0072083
                                       |
                                    dc |
                                    1  |  -4.178242   2.922705    -1.43   0.153     -9.90664    1.550155
                                    2  |  -4.408024   3.107393    -1.42   0.156     -10.4984    1.682355
                                    3  |  -7.329449   3.401392    -2.15   0.031    -13.99605   -.6628436
                                       |
                                 _cons |  -1.141493   7.007214    -0.16   0.871    -14.87538    12.59239
                          -------------+----------------------------------------------------------------
                               sigma_u |  4.6499065
                               sigma_e |  1.2617715
                                   rho |   .9314169   (fraction of variance due to u_i)
                          ------------------------------------------------------------------------------
                          BR Anne

                          Comment


                          • #14
                            Anne:
                            your second code is the way to go (I do not see how you -xtset- your dataset, though).
                            Clusters=21 might be a bit low, but you found both heteroskedsticity and autocorrelation so you should stick with 21 clusters.
                            Kind regards,
                            Carlo
                            (Stata 18.0 SE)

                            Comment


                            • #15
                              Hi Carlo,

                              Again thank you for your answer.
                              I am experiencing some weird results on some of my variables, which to me and theoretically doesnt make any sense. My energy prices (index=2015) for automotive diesel and oil products are producing negative coefficients and are significant - which in my case would mean that if the price of automotive diesel increase by 1 then energy poverty decrease by 0.21, when we move one unit on country and year. This makes absolutely no sense to me, and I am quite puzzled by what could explain it.
                              Have you experienced weird prefixes before, and do you have an idea to what I can do about it?

                              Can it possibly be explained by the bias variance tradeoff when chosing a random effects instead of a fixed effects model? Or could it be caused by the one unit change in the country variable?

                              Code:
                               
                              xtreg bincw dipa ddpa noren noown hhgp hhep epad epop epug wgge wgphs wgsst rec, re cluster()
                              
                              Random-effects GLS regression                   Number of obs     =        209
                              Group variable: cntry                           Number of groups  =         20
                              
                              R-squared:                                      Obs per group:
                                   Within  = 0.1957                                         min =          6
                                   Between = 0.7145                                         avg =       10.4
                                   Overall = 0.6331                                         max =         11
                              
                                                                              Wald chi2(13)     =     100.08
                              corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
                              
                              ------------------------------------------------------------------------------
                                     bincw | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
                              -------------+----------------------------------------------------------------
                                      dipa |    -.11896   .0437347    -2.72   0.007    -.2046785   -.0332416
                                      ddpa |   .0269258   .0433534     0.62   0.535    -.0580454     .111897
                                     noren |   -1.45799   3.400739    -0.43   0.668    -8.123315    5.207335
                                     noown |  -8.542249   3.724434    -2.29   0.022    -15.84201   -1.242492
                                      hhgp |   .3165467   .3465723     0.91   0.361    -.3627226     .995816
                                      hhep |  -.0073165   .1588096    -0.05   0.963    -.3185776    .3039445
                                      epad |  -.2064444   .0724658    -2.85   0.004    -.3484749    -.064414
                                      epop |  -.2397357    .136564    -1.76   0.079    -.5073962    .0279248
                                      epug |    .611444   .1521178     4.02   0.000     .3132985    .9095894
                                      wgge |   .1650103     .11456     1.44   0.150    -.0595232    .3895438
                                     wgphs |  -.4320382    .108138    -4.00   0.000    -.6439849   -.2200916
                                     wgsst |  -.1977692   .3066784    -0.64   0.519    -.7988478    .4033094
                                       rec |  -.1316739   .0720012    -1.83   0.067    -.2727936    .0094458
                                     _cons |     51.801   8.780813     5.90   0.000     34.59092    69.01108
                              -------------+----------------------------------------------------------------
                                   sigma_u |  4.1444811
                                   sigma_e |  3.0344652
                                       rho |   .6510107   (fraction of variance due to u_i)
                              ------------------------------------------------------------------------------
                              I am not sure if this can be caused by something methodological, which is why i wanted to run it by you.

                              BR Anne

                              Comment

                              Working...
                              X