Announcement

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

  • Determining best fe-model with paneldata (u-test)

    Hello! I am new to stata and am investigating the relationship between paid leave (maternal and parental) and female labour force participation rates with OECD paneldata. Literature that has also investigated this relationship uses a FE model with year dummies and country-specific time trends and find an inverse u-relationship. Unfortunately, I find different results and struggling with the fit of my data.

    I have done multiple tests where I have found out that i should include year dummies, trends and clustered SE (due to heteroscedasticity and autocorrelation) and that I should rely on a FE, rather than a RE model.

    When doing:
    xtset cou_1 year
    xtreg flfpr2554 moth_leave moth_leave_2 i.year i.cou_1#c.t, fe i(cou_1) vce(cluster cou_1)
    nlcom _b[moth_leave]/(2*-_b[moth_leave_2])

    adopath ++ "m:\p_arbeid\p_betaald_verlof\SSC install"
    utest moth_leave moth_leave_2
    (129 missing values generated)

    Specification: f(x)=x^2
    Extreme point: 538.5394

    Test:
    H1: Inverse U shape
    vs. H0: Monotone or U shape

    -------------------------------------------------
    | Lower bound Upper bound
    -----------------+-------------------------------
    Interval | 0 198
    Slope | .0351557 .0222303
    -------------------------------------------------

    Extremum outside interval - trivial failure to reject H0
    I get a weird extreme point and graphing the result also shows that it is probably not the best fit
    Code:
    graph twoway (scatter flfpr2554 moth_leave) (function y=[44.7195]+x*[.0351557]+x^2*[-.0000326], range(0 800))
    Click image for larger version

Name:	graph1.jpg
Views:	1
Size:	20.0 KB
ID:	1539989





    When not including year dummies and trends, my fit seems better.


    Code:
    use "m:\p_arbeid\p_betaald_verlof\Data\Stata files\7-1-regressions-2018", clear
    
    xtset cou_1 year
    
    gen moth_leave_2 = moth_leave*moth_leave
    xtreg flfpr2554 moth_leave moth_leave_2, fe i(cou_1)
    nlcom _b[moth_leave]/(2*-_b[moth_leave_2])
    
    adopath ++ "m:\p_arbeid\p_betaald_verlof\SSC install\"
    utest moth_leave moth_leave_2
    
    
    Specification: f(x)=x^2
    Extreme point:   138.853
    
    Test:
         H1: Inverse U shape
     vs. H0: Monotone or U shape
    
    -------------------------------------------------
                     |   Lower bound      Upper bound
    -----------------+-------------------------------
    Interval         |           0              198
    Slope            |    .4256187        -.1813002
    t-value          |    12.05258        -2.726574
    P>|t|            |    3.16e-31         .0032678
    -------------------------------------------------
    
    Overall test of presence of a Inverse U shape:
         t-value =      2.73
         P>|t|   =    .00327


    the u-test (presence of u-shape) becomes insignificant when clustering at country-level.

    Code:
    use "m:\p_arbeid\p_betaald_verlof\Data\Stata files\7-1-regressions-2018", clear
    
    xtset cou_1 year
    
    gen moth_leave_2 = moth_leave*moth_leave
    xtreg flfpr2554 moth_leave moth_leave_2, fe i(cou_1) vce(cluster cou_1)
    nlcom _b[moth_leave]/(2*-_b[moth_leave_2])
    
    adopath ++ "m:\p_arbeid\p_betaald_verlof\SSC install\"
    utest moth_leave moth_leave_2
    
    . utest moth_leave moth_leave_2
    (129 missing values generated)
    
    Specification: f(x)=x^2
    Extreme point:   138.853
    
    Test:
         H1: Inverse U shape
     vs. H0: Monotone or U shape
    
    -------------------------------------------------
                     |   Lower bound      Upper bound
    -----------------+-------------------------------
    Interval         |           0              198
    Slope            |    .4256187        -.1813002
    t-value          |    3.384718        -.6482774
    P>|t|            |    .0008667         .2604597
    -------------------------------------------------
    
    Overall test of presence of a Inverse U shape:
         t-value =      0.65
         P>|t|   =       .26
    Click image for larger version

Name:	graph2.png
Views:	1
Size:	262.4 KB
ID:	1539990


    However the tests did say I should include those and my r-squared goes down drastically when doing so.
    Model 1 is a naive OLS model, 2 a fixed effectsmodel without trends and year dummies, 3 is a fixed effects model with year dummies, 4 a fixed effects model with year dummies and trends, 5 is the same as 4 but with SE clustered at the country-level.

    Code:
     
    (1) (2) (3) (4) (5)
    VARIABLES flfpr2554 flfpr2554 flfpr2554 flfpr2554 flfpr2554
    moth_leave_div 16.1989*** 42.5619*** -13.2572*** 3.5156** 3.5156
    (3.0404) (3.5313) (2.7618) (1.5361) (3.0979)
    moth_leave_div_2 -7.3050*** -15.3262*** 7.1199*** -0.3264 -0.3264
    (1.4861) (2.3920) (1.6326) (0.9886) (1.7249)
    Constant 46.6809*** 52.0218*** 47.3923*** 44.7195*** 44.7195***
    (4.8106) (1.1491) (1.9779) (0.9649) (2.0572)
    Observations 863 863 863 863 863
    R-squared 0.3828 0.2037 0.7314 0.9618 0.9618
    Specification Quadratic Quadratic Quadratic Quadratic Quadratic
    Method LPM FE FE and year dummies FE and year dummies FE and year dummies
    Controls NO NO NO NO NO
    Clustering NO NO NO NO YES
    Number of cou_1 37 37 37 37 37
    Standard errors in parentheses
    *** p<0.01, ** p<0.05, * p<0.1
    When including controls (GDP, female unemployment rate, childcare costs, birth rate), the problem stays the same and I lose a lot of observations as the data is not available for the same nr. of countries/years.

    What do you think when seeing this? I do not know which model to go for or how to explain these results.

    Thank you in advance
    Last edited by Eva Mirre; 06 Mar 2020, 07:35.

  • #2
    Eva:
    some comments about your post:
    - you did not post what Stata gave you back after -xtreg-;
    - why not relating on -fvvarlist- notation for creating categorical variables and interactions?
    - it is not clear how you compared -fe- and -re- specification (-hausman-?);
    - it is unusual to include both -i.year- and year trends;
    - please note that, as far as -xtreg- is concerned, the R-sq to look at are the within (for -fe-) and the between (for -re) ones;
    - the R-sqs reported for model 4 and 5 give some concerns about overfitting.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo,

      Thank you for your response

      The table at the bottom shows the results for the xtreg but I can post it here too:
      Code:
      use "m:\p_arbeid\p_betaald_verlof\Data\Stata files\7-1-regressions-2018", clear
      
      . 
      . xtset cou_1 year
             panel variable:  cou_1 (unbalanced)
              time variable:  year, 1970 to 2018
                      delta:  1 unit
      
      . 
      . gen moth_leave_2 = moth_leave*moth_leave
      
      . xtreg flfpr2554 moth_leave moth_leave_2 i.year i.cou_1#c.t, fe i(cou_1) vce(cluster cou_1)
      note: 2017.year omitted because of collinearity
      note: 2018.year omitted because of collinearity
      note: 23.cou_1#c.t omitted because of collinearity
      note: 25.cou_1#c.t omitted because of collinearity
      note: 28.cou_1#c.t omitted because of collinearity
      note: 37.cou_1#c.t omitted because of collinearity
      
      Fixed-effects (within) regression               Number of obs     =        863
      Group variable: cou_1                           Number of groups  =         37
      
      R-sq:                                           Obs per group:
           within  = 0.9618                                         min =          1
           between = 0.0402                                         avg =       23.3
           overall = 0.0008                                         max =         47
      
                                                      F(31,36)          =          .
      corr(u_i, Xb)  = -0.7341                        Prob > F          =          .
      
                                       (Std. Err. adjusted for 37 clusters in cou_1)
      ------------------------------------------------------------------------------
                   |               Robust
         flfpr2554 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
        moth_leave |   .0351557   .0309793     1.13   0.264    -.0276733    .0979847
      moth_leave_2 |  -.0000326   .0001725    -0.19   0.851    -.0003825    .0003172
                   |
              year |
             1971  |   1.281622    1.08033     1.19   0.243    -.9093886    3.472632
             1972  |    1.95147   1.231851     1.58   0.122    -.5468404    4.449781
             1973  |   3.279862   1.519467     2.16   0.038     .1982396    6.361485
             1974  |   4.020391   1.865712     2.15   0.038     .2365523    7.804229
             1975  |   4.176674   1.863574     2.24   0.031       .39717    7.956178
             1976  |   4.173173    1.82765     2.28   0.028     .4665273    7.879818
             1977  |   5.337996   1.851994     2.88   0.007     1.581979    9.094013
             1978  |   5.611371   1.786801     3.14   0.003     1.987571    9.235171
             1979  |   5.975059   1.942175     3.08   0.004     2.036146    9.913973
             1980  |   7.224967   2.194226     3.29   0.002      2.77487    11.67506
             1981  |   7.161391   2.297383     3.12   0.004     2.502081     11.8207
             1982  |   8.390022   2.469329     3.40   0.002     3.381991    13.39805
             1983  |   8.804984   2.566123     3.43   0.002     3.600646    14.00932
             1984  |     8.9224   2.695514     3.31   0.002     3.455644    14.38916
             1985  |    10.1971   2.828328     3.61   0.001     4.460987    15.93322
             1986  |   11.04349   2.950691     3.74   0.001     5.059214    17.02777
             1987  |    11.9518   2.969696     4.02   0.000     5.928974    17.97462
             1988  |   12.49631   2.953598     4.23   0.000     6.506137    18.48648
             1989  |   13.63706   2.987816     4.56   0.000     7.577487    19.69663
             1990  |   14.52303   2.979984     4.87   0.000      8.47934    20.56671
             1991  |   15.31592   3.001277     5.10   0.000     9.229047    21.40279
             1992  |   16.28484    2.96995     5.48   0.000     10.26151    22.30818
             1993  |   16.31367   2.999255     5.44   0.000      10.2309    22.39645
             1994  |   16.34848    3.11724     5.24   0.000     10.02643    22.67054
             1995  |   16.61952    3.23976     5.13   0.000     10.04898    23.19006
             1996  |   17.16903   3.326434     5.16   0.000     10.42271    23.91535
             1997  |   17.63589   3.353463     5.26   0.000     10.83475    24.43703
             1998  |   17.99585   3.451966     5.21   0.000     10.99494    24.99676
             1999  |    18.2646   3.552192     5.14   0.000     11.06042    25.46878
             2000  |   18.74302   3.633901     5.16   0.000     11.37312    26.11291
             2001  |   18.75636   3.705439     5.06   0.000     11.24138    26.27134
             2002  |   19.14238    3.77446     5.07   0.000     11.48742    26.79734
             2003  |   19.50923   3.766212     5.18   0.000       11.871    27.14746
             2004  |   20.01589   3.836761     5.22   0.000     12.23458     27.7972
             2005  |   20.51569   3.924542     5.23   0.000     12.55635    28.47503
             2006  |   20.90952   3.959878     5.28   0.000     12.87851    28.94052
             2007  |   20.99969   4.049891     5.19   0.000     12.78613    29.21325
             2008  |   21.40405    4.06712     5.26   0.000     13.15555    29.65255
             2009  |   21.85753   4.016406     5.44   0.000     13.71188    30.00318
             2010  |   21.90545   3.968966     5.52   0.000     13.85602    29.95489
             2011  |   22.17821    3.97737     5.58   0.000     14.11173    30.24469
             2012  |   22.18203   3.970187     5.59   0.000     14.13012    30.23395
             2013  |   22.49106   4.000564     5.62   0.000     14.37754    30.60458
             2014  |   22.68321   3.997513     5.67   0.000     14.57588    30.79054
             2015  |   22.77802   4.023159     5.66   0.000     14.61868    30.93737
             2016  |   22.67064   4.025532     5.63   0.000     14.50648    30.83479
             2017  |          0  (omitted)
             2018  |          0  (omitted)
                   |
         cou_1#c.t |
              AUS  |   .2296558   .0878653     2.61   0.013     .0514567    .4078548
              AUT  |   .3662709   .0671554     5.45   0.000     .2300734    .5024685
              BEL  |   .3930032   .0786424     5.00   0.000     .2335091    .5524974
              CAN  |   -.165005    .040865    -4.04   0.000     -.247883    -.082127
              CHE  |  -.2784425   .0564191    -4.94   0.000    -.3928657   -.1640192
              CHL  |   .1562831   .1214548     1.29   0.206    -.0900386    .4026047
              CZE  |   .2305351   .1185558     1.94   0.060    -.0099072    .4709774
              DEU  |   1.009842    .064675    15.61   0.000     .8786755     1.14101
              DNK  |   -.664009   .0633886   -10.48   0.000     -.792567    -.535451
              ESP  |   .4040037   .0383313    10.54   0.000     .3262642    .4817431
              EST  |  -1.256417   .0855766   -14.68   0.000    -1.429974   -1.082859
              FIN  |   .4900389   .0397182    12.34   0.000     .4094866    .5705912
              FRA  |  -.4459416   .0666554    -6.69   0.000    -.5811251   -.3107582
              GBR  |   .3084689   .0853086     3.62   0.001     .1354551    .4814827
              GRC  |  -.4972982   .0792462    -6.28   0.000    -.6580169   -.3365794
              HUN  |   .9669379   .0807192    11.98   0.000     .8032318    1.130644
              IRL  |   -.546314   .0732507    -7.46   0.000    -.6948734   -.3977546
              ISL  |  -.3647622   .0893914    -4.08   0.000    -.5460563   -.1834681
              ISR  |  -.1437162   .1214548    -1.18   0.244    -.3900378    .1026055
              ITA  |   .1657409   .1191097     1.39   0.173    -.0758246    .4073065
              JPN  |  -.1009853   .0787906    -1.28   0.208    -.2607801    .0588094
              KOR  |   .5312621   .0915985     5.80   0.000     .3454917    .7170324
              LTU  |          0  (omitted)
              LUX  |  -.0015685   .0670449    -0.02   0.981    -.1375419    .1344049
              LVA  |          0  (omitted)
              MEX  |  -.4810981   .0864709    -5.56   0.000    -.6564692    -.305727
              NLD  |   .8854408    .079706    11.11   0.000     .7237896    1.047092
             NMEC  |          0  (omitted)
              NOR  |   .2392573   .0781078     3.06   0.004     .0808473    .3976673
              NZL  |   .3474887   .0894522     3.88   0.000     .1660713    .5289061
              POL  |  -.0372215   .0864748    -0.43   0.669    -.2126005    .1381574
              PRT  |   .0497162    .080457     0.62   0.541    -.1134581    .2128906
              SVK  |  -.1398749   .0444704    -3.15   0.003    -.2300651   -.0496846
              SVN  |   .3335842   .0855766     3.90   0.000     .1600269    .5071415
              SWE  |  -.0707903   .0399616    -1.77   0.085    -.1518363    .0102556
              TUR  |    .385299   .0648622     5.94   0.000     .2537524    .5168457
              USA  |          0  (omitted)
                   |
             _cons |   44.71951   2.057206    21.74   0.000      40.5473    48.89172
      -------------+----------------------------------------------------------------
           sigma_u |  22.664064
           sigma_e |  1.8067453
               rho |  .99368509   (fraction of variance due to u_i)
      ------------------------------------------------------------------------------
      
      . 
      end of do-file
      
      .
      Code:
      . xtreg flfpr2554 moth_leave moth_leave_2 i.year, fe  i(cou_1) vce(cluster cou_1)
      note: 2017.year omitted because of collinearity
      note: 2018.year omitted because of collinearity
      
      Fixed-effects (within) regression               Number of obs     =        863
      Group variable: cou_1                           Number of groups  =         37
      
      R-sq:                                           Obs per group:
           within  = 0.7314                                         min =          1
           between = 0.0041                                         avg =       23.3
           overall = 0.2942                                         max =         47
      
                                                      F(33,36)          =          .
      corr(u_i, Xb)  = -0.1062                        Prob > F          =          .
      
                                       (Std. Err. adjusted for 37 clusters in cou_1)
      ------------------------------------------------------------------------------
                   |               Robust
         flfpr2554 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
        moth_leave |  -.1325721   .1546258    -0.86   0.397    -.4461677    .1810236
      moth_leave_2 |    .000712   .0008357     0.85   0.400    -.0009829    .0024068
                   |
              year |
             1971  |  -1.140428   1.674106    -0.68   0.500    -4.535672    2.254816
             1972  |   .2031652   1.215512     0.17   0.868    -2.262008    2.668339
             1973  |     2.2175   1.326963     1.67   0.103    -.4737069    4.908706
             1974  |   3.188929   1.579634     2.02   0.051    -.0147165    6.392575
             1975  |   2.375633   2.472764     0.96   0.343    -2.639364     7.39063
             1976  |    4.66175   2.170328     2.15   0.039     .2601219    9.063379
             1977  |   4.431156   2.723405     1.63   0.112    -1.092165    9.954477
             1978  |   6.561751   2.022845     3.24   0.003     2.459231    10.66427
             1979  |   5.693657   2.646712     2.15   0.038     .3258766    11.06144
             1980  |   9.118278   2.217001     4.11   0.000     4.621991    13.61456
             1981  |   8.422752   2.909581     2.89   0.006     2.521847    14.32366
             1982  |   11.11097   2.474479     4.49   0.000     6.092496    16.12945
             1983  |   11.81493   3.214938     3.68   0.001     5.294735    18.33513
             1984  |   11.38285   2.949529     3.86   0.000     5.400929    17.36477
             1985  |   12.67521   2.815103     4.50   0.000     6.965921    18.38451
             1986  |   13.78109   2.924491     4.71   0.000     7.849943    19.71223
             1987  |   14.93065   2.993087     4.99   0.000     8.860392    21.00091
             1988  |   16.50668   3.048316     5.42   0.000     10.32441    22.68896
             1989  |   17.26514   3.023238     5.71   0.000     11.13373    23.39655
             1990  |   19.16668   3.303537     5.80   0.000      12.4668    25.86657
             1991  |   19.99695   3.506949     5.70   0.000     12.88452    27.10937
             1992  |   21.25206     3.4845     6.10   0.000     14.18517    28.31896
             1993  |   21.87188   3.518813     6.22   0.000     14.73539    29.00836
             1994  |   22.45969   3.701841     6.07   0.000     14.95201    29.96737
             1995  |   22.66063   3.706251     6.11   0.000     15.14401    30.17726
             1996  |   23.06184   3.761091     6.13   0.000     15.43399    30.68968
             1997  |   23.72902   3.807782     6.23   0.000     16.00648    31.45156
             1998  |    24.3551   3.868893     6.30   0.000     16.50863    32.20158
             1999  |   25.19072   4.135472     6.09   0.000     16.80359    33.57784
             2000  |   26.43497   4.344212     6.09   0.000      17.6245    35.24544
             2001  |   26.61439    4.38065     6.08   0.000     17.73002    35.49876
             2002  |   27.30637   4.516273     6.05   0.000     18.14695     36.4658
             2003  |   27.98529    4.66887     5.99   0.000     18.51639     37.4542
             2004  |   28.75379   4.773883     6.02   0.000      19.0719    38.43567
             2005  |   29.34683    4.78908     6.13   0.000     19.63413    39.05954
             2006  |   30.07762   4.949239     6.08   0.000      20.0401    40.11514
             2007  |   30.53881   5.047241     6.05   0.000     20.30253    40.77509
             2008  |   31.18976   5.306802     5.88   0.000     20.42707    41.95245
             2009  |   32.12825   5.426903     5.92   0.000     21.12198    43.13452
             2010  |   31.89762   5.424202     5.88   0.000     20.89683    42.89842
             2011  |   32.82199    5.53576     5.93   0.000     21.59495    44.04903
             2012  |   32.80601   5.567798     5.89   0.000       21.514    44.09803
             2013  |   33.59518   5.600982     6.00   0.000     22.23586     44.9545
             2014  |   33.90887    5.57107     6.09   0.000     22.61022    45.20753
             2015  |    34.0394   5.488576     6.20   0.000     22.90805    45.17075
             2016  |   34.04204   5.501926     6.19   0.000     22.88362    45.20047
             2017  |          0  (omitted)
             2018  |          0  (omitted)
                   |
             _cons |   47.39232    3.06281    15.47   0.000     41.18066    53.60399
      -------------+----------------------------------------------------------------
           sigma_u |  15.256911
           sigma_e |  4.6882164
               rho |  .91372271   (fraction of variance due to u_i)
      ------------------------------------------------------------------------------
      
      . 
      end of do-file
      
      .
      Code:
       use "m:\p_arbeid\p_betaald_verlof\Data\Stata files\7-1-regressions-2018", clear
      
      . 
      . xtset cou_1 year
             panel variable:  cou_1 (unbalanced)
              time variable:  year, 1970 to 2018
                      delta:  1 unit
      
      . 
      . gen moth_leave_2 = moth_leave*moth_leave
      
      . xtreg flfpr2554 moth_leave moth_leave_2, fe vce(cluster cou_1)
      
      Fixed-effects (within) regression               Number of obs     =        863
      Group variable: cou_1                           Number of groups  =         37
      
      R-sq:                                           Obs per group:
           within  = 0.2037                                         min =          1
           between = 0.0916                                         avg =       23.3
           overall = 0.1113                                         max =         47
      
                                                      F(2,36)           =      11.81
      corr(u_i, Xb)  = -0.2773                        Prob > F          =     0.0001
      
                                       (Std. Err. adjusted for 37 clusters in cou_1)
      ------------------------------------------------------------------------------
                   |               Robust
         flfpr2554 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
        moth_leave |   .4256187   .1257471     3.38   0.002     .1705916    .6806457
      moth_leave_2 |  -.0015326   .0009799    -1.56   0.127      -.00352    .0004547
             _cons |   52.02178    3.32838    15.63   0.000     45.27151    58.77204
      -------------+----------------------------------------------------------------
           sigma_u |  12.413841
           sigma_e |  7.8441408
               rho |  .71465285   (fraction of variance due to u_i)
      ------------------------------------------------------------------------------
      
      . 
      end of do-file
      
      .
      With fvvarlist you mean the following right? I can use it too, but the results do not change

      Code:
      . xtreg flfpr2554 c.moth_leave c.moth_leave#c.moth_leave, fe vce(cluster cou_1)
      
      Fixed-effects (within) regression               Number of obs     =        863
      Group variable: cou_1                           Number of groups  =         37
      
      R-sq:                                           Obs per group:
           within  = 0.2037                                         min =          1
           between = 0.0916                                         avg =       23.3
           overall = 0.1113                                         max =         47
      
                                                      F(2,36)           =      11.81
      corr(u_i, Xb)  = -0.2773                        Prob > F          =     0.0001
      
                                                    (Std. Err. adjusted for 37 clusters in cou_1)
      -------------------------------------------------------------------------------------------
                                |               Robust
                      flfpr2554 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      --------------------------+----------------------------------------------------------------
                     moth_leave |   .4256187   .1257471     3.38   0.002     .1705916    .6806457
                                |
      c.moth_leave#c.moth_leave |  -.0015326   .0009799    -1.56   0.127      -.00352    .0004547
                                |
                          _cons |   52.02178    3.32838    15.63   0.000     45.27151    58.77204
      --------------------------+----------------------------------------------------------------
                        sigma_u |  12.413841
                        sigma_e |  7.8441408
                            rho |  .71465285   (fraction of variance due to u_i)
      -------------------------------------------------------------------------------------------
      
      .

      Comment


      • #4

        Hausman:
        Code:
        xtset cou_1 year
               panel variable:  cou_1 (unbalanced)
                time variable:  year, 1970 to 2018
                        delta:  1 unit
        
        . xtreg flfpr2554 moth_leave_div i.year i.cou_1#c.t, fe
        note: 2017.year omitted because of collinearity
        note: 2018.year omitted because of collinearity
        note: 23.cou_1#c.t omitted because of collinearity
        note: 25.cou_1#c.t omitted because of collinearity
        note: 28.cou_1#c.t omitted because of collinearity
        note: 37.cou_1#c.t omitted because of collinearity
        
        Fixed-effects (within) regression               Number of obs     =        863
        Group variable: cou_1                           Number of groups  =         37
        
        R-sq:                                           Obs per group:
             within  = 0.9618                                         min =          1
             between = 0.0400                                         avg =       23.3
             overall = 0.0008                                         max =         47
        
                                                        F(80,746)         =     234.77
        corr(u_i, Xb)  = -0.7348                        Prob > F          =     0.0000
        
        --------------------------------------------------------------------------------
             flfpr2554 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        ---------------+----------------------------------------------------------------
        moth_leave_div |   3.079144   .7819813     3.94   0.000     1.543998     4.61429
                       |
                  year |
                 1971  |   1.285744   1.025867     1.25   0.210    -.7281864    3.299674
                 1972  |   1.956006   1.068606     1.83   0.068    -.1418275    4.053839
                 1973  |   3.289652   1.140094     2.89   0.004     1.051478    5.527825
                 1974  |       4.03   1.231677     3.27   0.001     1.612034    6.447966
                 1975  |   4.200032   1.323245     3.17   0.002     1.602305     6.79776
                 1976  |   4.199553    1.46458     2.87   0.004     1.324363    7.074742
                 1977  |   5.364387   1.580752     3.39   0.001     2.261136    8.467639
                 1978  |    5.63739   1.735999     3.25   0.001     2.229366    9.045414
                 1979  |   6.000919   1.868547     3.21   0.001     2.332683    9.669156
                 1980  |    7.25159   2.021119     3.59   0.000     3.283832    11.21935
                 1981  |   7.196348   2.167857     3.32   0.001     2.940522    11.45217
                 1982  |   8.426068   2.335278     3.61   0.000     3.841569    13.01057
                 1983  |   8.836238   2.472651     3.57   0.000     3.982056    13.69042
                 1984  |    8.95281   2.635279     3.40   0.001     3.779364    14.12626
                 1985  |   10.22471   2.798238     3.65   0.000     4.731354    15.71807
                 1986  |   11.07108   2.964774     3.73   0.000     5.250781    16.89137
                 1987  |   11.97898   3.132332     3.82   0.000     5.829745    18.12821
                 1988  |   12.52551   3.299326     3.80   0.000     6.048446    19.00258
                 1989  |    13.6674   3.470087     3.94   0.000     6.855101     20.4797
                 1990  |   14.55552   3.638983     4.00   0.000     7.411652    21.69938
                 1991  |   15.35347   3.807704     4.03   0.000     7.878375    22.82856
                 1992  |   16.31661   3.978038     4.10   0.000     8.507133     24.1261
                 1993  |   16.34432   4.148878     3.94   0.000     8.199454    24.48918
                 1994  |   16.37799   4.319508     3.79   0.000     7.898148    24.85782
                 1995  |   16.64739   4.492133     3.71   0.000     7.828663    25.46611
                 1996  |   17.19379   4.664176     3.69   0.000     8.037315    26.35026
                 1997  |   17.66255   4.836421     3.65   0.000     8.167933    27.15716
                 1998  |   18.02174    5.00902     3.60   0.000      8.18829     27.8552
                 1999  |   18.28948   5.182138     3.53   0.000     8.116171    28.46279
                 2000  |   18.76667   5.355467     3.50   0.000      8.25309    29.28025
                 2001  |   18.78496   5.528988     3.40   0.001     7.930733    29.63919
                 2002  |   19.17126   5.701738     3.36   0.001     7.977898    30.36462
                 2003  |    19.5391   5.874647     3.33   0.001     8.006294    31.07191
                 2004  |   20.04571   6.047672     3.31   0.001     8.173229    31.91819
                 2005  |   20.54552   6.220644     3.30   0.001     8.333473    32.75758
                 2006  |    20.9408   6.426008     3.26   0.001     8.325593    33.55602
                 2007  |   21.02958   6.592881     3.19   0.001     8.086772    33.97239
                 2008  |   21.44614   6.759236     3.17   0.002     8.176748    34.71552
                 2009  |   21.90039   6.927084     3.16   0.002     8.301493    35.49929
                 2010  |    21.9473   7.094839     3.09   0.002     8.019077    35.87553
                 2011  |   22.21942   7.261595     3.06   0.002     7.963825    36.47501
                 2012  |   22.22215   7.429241     2.99   0.003     7.637442    36.80685
                 2013  |   22.52974   7.596135     2.97   0.003     7.617397    37.44209
                 2014  |   22.71982   7.763506     2.93   0.004     7.478897    37.96074
                 2015  |   22.81224   7.930808     2.88   0.004     7.242885     38.3816
                 2016  |   22.70376   8.098787     2.80   0.005     6.804635    38.60289
                 2017  |          0  (omitted)
                 2018  |          0  (omitted)
                       |
             cou_1#c.t |
                  AUS  |     .23061   .1770363     1.30   0.193    -.1169385    .5781586
                  AUT  |   .3702568   .1853503     2.00   0.046     .0063865    .7341271
                  BEL  |    .394125   .1785581     2.21   0.028     .0435887    .7446612
                  CAN  |  -.1654455   .1961401    -0.84   0.399    -.5504978    .2196067
                  CHE  |  -.2739053    .200469    -1.37   0.172    -.6674559    .1196452
                  CHL  |   .1580256   1.309902     0.12   0.904    -2.413506    2.729558
                  CZE  |   .2473402   .1832207     1.35   0.177    -.1123494    .6070297
                  DEU  |   1.014406   .1882671     5.39   0.000     .6448095    1.384002
                  DNK  |  -.6657465   .3143247    -2.12   0.035    -1.282813   -.0486802
                  ESP  |   .4033588   .2007006     2.01   0.045     .0093536     .797364
                  EST  |  -1.254573   .6053935    -2.07   0.039    -2.443051   -.0660954
                  FIN  |     .48909   .1961346     2.49   0.013     .1040485    .8741314
                  FRA  |  -.4442541   .1835032    -2.42   0.016    -.8044982   -.0840101
                  GBR  |   .3080292   .1772031     1.74   0.083    -.0398469    .6559053
                  GRC  |  -.4962428   .1790918    -2.77   0.006    -.8478268   -.1446588
                  HUN  |   .9641369   .1771542     5.44   0.000     .6163569    1.311917
                  IRL  |  -.5445888   .1814893    -3.00   0.003    -.9008792   -.1882983
                  ISL  |  -.3631657   .1770922    -2.05   0.041    -.7108241   -.0155073
                  ISR  |  -.1419737   1.309902    -0.11   0.914    -2.713506    2.429558
                  ITA  |   .1657543   .1814994     0.91   0.361     -.190556    .5220647
                  JPN  |  -.0993308   .1791461    -0.55   0.579    -.4510214    .2523597
                  KOR  |    .535797   .1798393     2.98   0.003     .1827458    .8888483
                  LTU  |          0  (omitted)
                  LUX  |  -.0003222   .1825297    -0.00   0.999    -.3586553    .3580109
                  LVA  |          0  (omitted)
                  MEX  |  -.4814764   .1876026    -2.57   0.010    -.8497682   -.1131846
                  NLD  |   .8863046   .1775541     4.99   0.000     .5377395     1.23487
                 NMEC  |          0  (omitted)
                  NOR  |   .2391054    .180386     1.33   0.185    -.1150191      .59323
                  NZL  |   .3491401   .1770687     1.97   0.049     .0015278    .6967524
                  POL  |  -.0369344   .1770717    -0.21   0.835    -.3845526    .3106838
                  PRT  |   .0504306   .1779747     0.28   0.777    -.2989603    .3998215
                  SVK  |  -.1447064   .1961397    -0.74   0.461    -.5297578     .240345
                  SVN  |   .3354279   .6053935     0.55   0.580    -.8530497    1.523906
                  SWE  |  -.0716421   .1961287    -0.37   0.715     -.456672    .3133877
                  TUR  |   .3860203   .1816694     2.12   0.034     .0293762    .7426645
                  USA  |          0  (omitted)
                       |
                 _cons |    44.7021   .9628916    46.42   0.000      42.8118     46.5924
        ---------------+----------------------------------------------------------------
               sigma_u |  22.680705
               sigma_e |   1.805666
                   rho |  .99370178   (fraction of variance due to u_i)
        --------------------------------------------------------------------------------
        F test that all u_i=0: F(36, 746) = 348.12                   Prob > F = 0.0000
        
        . estimates store FE
        
        . xtreg flfpr2554 moth_leave_div i.year i.cou_1#c.t, re 
        note: 23.cou_1#c.t omitted because of collinearity
        note: 28.cou_1#c.t omitted because of collinearity
        note: 37.cou_1#c.t omitted because of collinearity
        
        Random-effects GLS regression                   Number of obs     =        863
        Group variable: cou_1                           Number of groups  =         37
        
        R-sq:                                           Obs per group:
             within  = 0.5114                                         min =          1
             between = 0.9773                                         avg =       23.3
             overall = 0.7751                                         max =         47
        
                                                        Wald chi2(83)     =    2684.71
        corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
        
        --------------------------------------------------------------------------------
             flfpr2554 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
        ---------------+----------------------------------------------------------------
        moth_leave_div |  -9.404837   1.101324    -8.54   0.000    -11.56339   -7.246282
                       |
                  year |
                 1971  |   -3.54552   4.027865    -0.88   0.379    -11.43999    4.348951
                 1972  |  -.8841654   4.035894    -0.22   0.827    -8.794373    7.026042
                 1973  |   .8234118   4.039975     0.20   0.838    -7.094794    8.741617
                 1974  |   1.331327   4.041497     0.33   0.742    -6.589862    9.252515
                 1975  |  -1.551442   3.927146    -0.40   0.693    -9.248507    6.145623
                 1976  |   1.892057   4.051817     0.47   0.641    -6.049359    9.833473
                 1977  |   -.257756   3.936407    -0.07   0.948    -7.972972     7.45746
                 1978  |   2.865028   4.060399     0.71   0.480    -5.093208    10.82326
                 1979  |   .1647978    3.94727     0.04   0.967    -7.571709    7.901304
                 1980  |   3.329197   3.954246     0.84   0.400    -4.420982    11.07938
                 1981  |   1.159182   3.868571     0.30   0.764    -6.423079    8.741443
                 1982  |   4.454499   3.971586     1.12   0.262    -3.329667    12.23867
                 1983  |   2.976523   3.645146     0.82   0.414    -4.167833    10.12088
                 1984  |   3.880219   3.655535     1.06   0.288    -3.284498    11.04494
                 1985  |    4.68037   3.627518     1.29   0.197    -2.429434    11.79017
                 1986  |   5.370559   3.640483     1.48   0.140    -1.764656    12.50577
                 1987  |   6.104455   3.654301     1.67   0.095    -1.057845    13.26675
                 1988  |     6.3474   3.634876     1.75   0.081    -.7768269    13.47163
                 1989  |   7.584857   3.684258     2.06   0.040     .3638441    14.80587
                 1990  |   9.491651   3.665799     2.59   0.010     2.306817    16.67648
                 1991  |    10.0123    3.62466     2.76   0.006     2.908097     17.1165
                 1992  |   10.99143   3.618317     3.04   0.002     3.899664     18.0832
                 1993  |   11.37839   3.615368     3.15   0.002     4.292402    18.46438
                 1994  |   11.59329    3.59768     3.22   0.001     4.541966    18.64461
                 1995  |   11.74713   3.634951     3.23   0.001     4.622756     18.8715
                 1996  |   11.68193   3.637962     3.21   0.001     4.551654     18.8122
                 1997  |   11.77182     3.6598     3.22   0.001     4.598743     18.9449
                 1998  |   11.98399   3.682201     3.25   0.001     4.767009    19.20097
                 1999  |   12.72528   3.719609     3.42   0.001     5.434986    20.01558
                 2000  |   13.99595    3.66273     3.82   0.000     6.817135    21.17477
                 2001  |   13.40961   3.682837     3.64   0.000     6.191383    20.62784
                 2002  |   13.70124   3.707817     3.70   0.000      6.43405    20.96843
                 2003  |   13.95568    3.73344     3.74   0.000     6.638275    21.27309
                 2004  |   14.30088   3.759739     3.80   0.000     6.931925    21.66983
                 2005  |    14.5619   3.777356     3.86   0.000     7.158419    21.96538
                 2006  |   14.83596   3.769076     3.94   0.000     7.448708    22.22321
                 2007  |   14.72878   3.794483     3.88   0.000     7.291725    22.16583
                 2008  |   14.87967   3.814603     3.90   0.000     7.403188    22.35616
                 2009  |   15.15833   3.849263     3.94   0.000     7.613913    22.70275
                 2010  |   14.76341   3.876391     3.81   0.000     7.165826      22.361
                 2011  |   14.99078   3.906426     3.84   0.000     7.334329    22.64724
                 2012  |   14.93889    3.91585     3.81   0.000     7.263965    22.61382
                 2013  |    14.9883   3.951539     3.79   0.000     7.243425    22.73317
                 2014  |   14.90019   3.972309     3.75   0.000     7.114603    22.68577
                 2015  |   14.57286   4.004404     3.64   0.000     6.724369    22.42134
                 2016  |   14.12677    4.03667     3.50   0.000     6.215044     22.0385
                 2017  |   41.84136     7.8222     5.35   0.000     26.51013    57.17259
                 2018  |   37.71116   7.852156     4.80   0.000     22.32122    53.10111
                       |
             cou_1#c.t |
                  AUS  |   .2747496   .0666483     4.12   0.000     .1441213    .4053779
                  AUT  |   .6814959   .0733581     9.29   0.000     .5377167     .825275
                  BEL  |   .4215583   .0677901     6.22   0.000      .288692    .5544245
                  CAN  |    .544372   .0727036     7.49   0.000     .4018755    .6868684
                  CHE  |   .1585386   .0722416     2.19   0.028     .0169477    .3001295
                  CHL  |   .4867203   .1087129     4.48   0.000     .2736469    .6997938
                  CZE  |   .9268469   .0845755    10.96   0.000      .761082    1.092612
                  DEU  |   .0455412   .0725046     0.63   0.530    -.0965653    .1876476
                  DNK  |   .6706606   .1579138     4.25   0.000     .3611552    .9801659
                  ESP  |   .2029315   .0722578     2.81   0.005     .0613088    .3445542
                  EST  |   .3862554    .102818     3.76   0.000     .1847357     .587775
                  FIN  |   .8067978   .0861024     9.37   0.000     .6380401    .9755555
                  FRA  |   .6080672   .0693017     8.77   0.000     .4722383     .743896
                  GBR  |   .6363276   .0704986     9.03   0.000     .4981528    .7745023
                  GRC  |   .8136382   .0686149    11.86   0.000     .6791555    .9481209
                  HUN  |    .596692   .0907809     6.57   0.000     .4187646    .7746193
                  IRL  |   .7164764   .0690782    10.37   0.000     .5810856    .8518672
                  ISL  |   .8298544   .0673256    12.33   0.000     .6978986    .9618102
                  ISR  |   .4950843    .108495     4.56   0.000     .2824379    .7077307
                  ITA  |   .6471597   .1055891     6.13   0.000      .440209    .8541104
                  JPN  |   .5847096   .0696053     8.40   0.000     .4482857    .7211336
                  KOR  |   .1914957   .0684338     2.80   0.005      .057368    .3256235
                  LTU  |          0  (omitted)
                  LUX  |    .405482   .0693973     5.84   0.000     .2694658    .5414982
                  LVA  |   -.438484   .2185373    -2.01   0.045    -.8668092   -.0101588
                  MEX  |  -.6523936    .093164    -7.00   0.000    -.8349917   -.4697954
                  NLD  |   .1151844    .067556     1.71   0.088    -.0172229    .2475918
                 NMEC  |          0  (omitted)
                  NOR  |   .4677535    .071388     6.55   0.000     .3278356    .6076714
                  NZL  |  -.0490552   .0668175    -0.73   0.463    -.1800151    .0819047
                  POL  |   .3088755   .0677297     4.56   0.000     .1761277    .4416234
                  PRT  |  -.0253862   .0672873    -0.38   0.706    -.1572669    .1064946
                  SVK  |   1.051285   .0890023    11.81   0.000     .8768433    1.225726
                  SVN  |   .5022701   .0929223     5.41   0.000     .3201458    .6843945
                  SWE  |   .6864017   .0732546     9.37   0.000     .5428253    .8299782
                  TUR  |  -.3304355    .068049    -4.86   0.000    -.4638091    -.197062
                  USA  |          0  (omitted)
                       |
                 _cons |   50.11271    2.95976    16.93   0.000     44.31169    55.91373
        ---------------+----------------------------------------------------------------
               sigma_u |          0
               sigma_e |   1.805666
                   rho |          0   (fraction of variance due to u_i)
        --------------------------------------------------------------------------------
        
        . estimates store RE
        
        . hausman FE RE, sigmamore
        
        Note: the rank of the differenced variance matrix (33) does not equal the number of coefficients being tested (80); be sure this is what you expect, or there may be
                problems computing the test.  Examine the output of your estimators for anything unexpected and possibly consider scaling your variables so that the
                coefficients are on a similar scale.
        
                         ---- Coefficients ----
                     |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
                     |       FE           RE         Difference          S.E.
        -------------+----------------------------------------------------------------
        moth_leave~v |    3.079144    -9.404837        12.48398         2.93523
                year |
               1971  |    1.285744     -3.54552        4.831263        .8315442
               1972  |    1.956006    -.8841654        2.840171        1.437187
               1973  |    3.289652     .8234118         2.46624        2.137841
               1974  |        4.03     1.331327        2.698673        2.837136
               1975  |    4.200032    -1.551442        5.751474        3.566623
               1976  |    4.199553     1.892057        2.307495        4.249594
               1977  |    5.364387     -.257756        5.622143        4.966615
               1978  |     5.63739     2.865028        2.772362        5.652601
               1979  |    6.000919     .1647978        5.836121        6.366871
               1980  |     7.25159     3.329197        3.922393        7.072513
               1981  |    7.196348     1.159182        6.037166        7.782697
               1982  |    8.426068     4.454499        3.971569        8.478231
               1983  |    8.836238     2.976523        5.859715          9.2186
               1984  |     8.95281     3.880219        5.072591        9.912539
               1985  |    10.22471      4.68037        5.544342        10.61575
               1986  |    11.07108     5.370559        5.700516        11.31485
               1987  |    11.97898     6.104455        5.874525        12.01438
               1988  |    12.52551       6.3474        6.178114        12.71809
               1989  |     13.6674     7.584857        6.082542        13.41522
               1990  |    14.55552     9.491651        5.063868        14.12099
               1991  |    15.35347      10.0123        5.341167        14.82891
               1992  |    16.31661     10.99143         5.32518        15.53248
               1993  |    16.34432     11.37839        4.965926         16.2356
               1994  |    16.37799     11.59329        4.784696        16.93951
               1995  |    16.64739     11.74713        4.900259        17.63877
               1996  |    17.19379     11.68193         5.51186        18.34185
               1997  |    17.66255     11.77182        5.890729        19.04118
               1998  |    18.02174     11.98399        6.037753        19.74119
               1999  |    18.28948     12.72528        5.564196        20.44003
               2000  |    18.76667     13.99595        4.770718        21.15589
               2001  |    18.78496     13.40961        5.375349        21.85818
               2002  |    19.17126     13.70124        5.470021        22.55613
               2003  |     19.5391     13.95568         5.58342        23.25426
               2004  |    20.04571     14.30088        5.744833        23.95245
               2005  |    20.54552      14.5619        5.983623        24.65147
               2006  |     20.9408     14.83596        6.104843        25.48531
               2007  |    21.02958     14.72878        6.300804        26.15774
               2008  |    21.44614     14.87967        6.566464        26.82863
               2009  |    21.90039     15.15833        6.742063        27.50332
               2010  |     21.9473     14.76341        7.183891        28.17855
               2011  |    22.21942     14.99078        7.228633        28.84919
               2012  |    22.22215     14.93889        7.283257        29.52604
               2013  |    22.52974      14.9883        7.541443        30.19622
               2014  |    22.71982     14.90019        7.819631        30.87016
               2015  |    22.81224     14.57286        8.239386        31.54224
               2016  |    22.70376     14.12677        8.576989        32.21695
           cou_1#c.t |
                  1  |      .23061     .2747496       -.0441395        .7066201
                  2  |    .3702568     .6814959       -.3112391        .7394583
                  3  |     .394125     .4215583       -.0274333        .7126406
                  4  |   -.1654455      .544372       -.7098175        .7829772
                  5  |   -.2739053     .1585386       -.4324439        .8004472
                  6  |    .1580256     .4867203       -.3286948        5.250402
                  7  |    .2473402     .9268469       -.6795068        .7296651
                  8  |    1.014406     .0455412        .9688648        .7512914
                  9  |   -.6657465     .6706606       -1.336407        1.250226
                 10  |    .4033588     .2029315        .2004273         .801378
                 11  |   -1.254573     .3862554       -1.640828        2.424905
                 12  |      .48909     .8067978       -.3177079        .7815952
                 13  |   -.4442541     .6080672       -1.052321        .7324113
                 14  |    .3080292     .6363276       -.3282984        .7069186
                 15  |   -.4962428     .8136382       -1.309881        .7147112
                 16  |    .9641369      .596692         .367445        .7044033
                 17  |   -.5445888     .7164764       -1.261065        .7243222
                 18  |   -.3631657     .8298544        -1.19302        .7067813
                 19  |   -.1419737     .4950843        -.637058        5.250407
                 20  |    .1657543     .6471597       -.4814054        .7199476
                 21  |   -.0993308     .5847096       -.6840405         .714834
                 22  |     .535797     .1914957        .3443013        .7177387
                 24  |   -.0003222      .405482       -.4058042        .7284822
                 26  |   -.4814764    -.6523936        .1709172        .7463253
                 27  |    .8863046     .1151844        .7711202        .7086193
                 29  |    .2391054     .4677535       -.2286481        .7196535
                 30  |    .3491401    -.0490552        .3981953        .7067348
                 31  |   -.0369344     .3088755       -.3458099        .7066601
                 32  |    .0504306    -.0253862        .0758168        .7103388
                 33  |   -.1447064     1.051285       -1.195991        .7812907
                 34  |    .3354279     .5022701       -.1668422        2.425304
                 35  |   -.0716421     .6864017       -.7580438          .78288
                 36  |    .3860203    -.3304355        .7164559        .7251451
        ------------------------------------------------------------------------------
                                   b = consistent under Ho and Ha; obtained from xtreg
                    B = inconsistent under Ha, efficient under Ho; obtained from xtreg
        
            Test:  Ho:  difference in coefficients not systematic
        
                         chi2(33) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                                  =      732.59
                        Prob>chi2 =      0.0000
                        (V_b-V_B is not positive definite)
        
        . 
        end of do-file
        
        .
        I noticed now that when doing a Hausman test without country-specific time trends, it fails to reject the hypothesis that a RE-model is not appropriate.

        xtset cou_1 year
        panel variable: cou_1 (unbalanced)
        time variable: year, 1970 to 2018
        delta: 1 unit

        . xtreg flfpr2554 moth_leave_div i.year, fe
        note: 2017.year omitted because of collinearity
        note: 2018.year omitted because of collinearity

        Fixed-effects (within) regression Number of obs = 863
        Group variable: cou_1 Number of groups = 37

        R-sq: Obs per group:
        within = 0.7249 min = 1
        between = 0.0074 avg = 23.3
        overall = 0.3230 max = 47

        F(47,779) = 43.67
        corr(u_i, Xb) = -0.0445 Prob > F = 0.0000

        --------------------------------------------------------------------------------
        flfpr2554 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
        ---------------+----------------------------------------------------------------
        moth_leave_div | -2.587295 1.295977 -2.00 0.046 -5.131316 -.0432732
        |
        year |
        1971 | -1.25569 2.641066 -0.48 0.635 -6.44014 3.92876
        1972 | -.2231732 2.641291 -0.08 0.933 -5.408064 4.961718
        1973 | 1.616781 2.643514 0.61 0.541 -3.572474 6.806036
        1974 | 2.588211 2.643514 0.98 0.328 -2.601044 7.777466
        1975 | 1.462541 2.571525 0.57 0.570 -3.585398 6.510481
        1976 | 3.608482 2.649197 1.36 0.174 -1.591928 8.808893
        1977 | 3.408692 2.574211 1.32 0.186 -1.64452 8.461904
        1978 | 5.508483 2.649197 2.08 0.038 .308072 10.70889
        1979 | 4.671193 2.574211 1.81 0.070 -.3820197 9.724405
        1980 | 8.059026 2.575131 3.13 0.002 3.004007 13.11404
        1981 | 7.171535 2.518094 2.85 0.005 2.228482 12.11459
        1982 | 9.804206 2.578389 3.80 0.000 4.742793 14.86562
        1983 | 10.79261 2.364379 4.56 0.000 6.151303 15.43392
        1984 | 10.45139 2.359336 4.43 0.000 5.819985 15.0828
        1985 | 11.78857 2.331742 5.06 0.000 7.211331 16.36581
        1986 | 12.87454 2.331976 5.52 0.000 8.296835 17.45224
        1987 | 14.01395 2.332095 6.01 0.000 9.436011 18.59188
        1988 | 15.48295 2.313263 6.69 0.000 10.94198 20.02392
        1989 | 16.22892 2.333348 6.96 0.000 11.64853 20.80932
        1990 | 18.06979 2.312394 7.81 0.000 13.53052 22.60905
        1991 | 18.9898 2.278983 8.33 0.000 14.51613 23.46348
        1992 | 20.31404 2.26461 8.97 0.000 15.86858 24.7595
        1993 | 20.91492 2.251184 9.29 0.000 16.49581 25.33402
        1994 | 21.43907 2.235403 9.59 0.000 17.05094 25.8272
        1995 | 21.65845 2.24574 9.64 0.000 17.25003 26.06687
        1996 | 22.08714 2.238718 9.87 0.000 17.69251 26.48178
        1997 | 22.68368 2.236442 10.14 0.000 18.29351 27.07385
        1998 | 23.27589 2.237566 10.40 0.000 18.88352 27.66826
        1999 | 24.03585 2.261482 10.63 0.000 19.59652 28.47517
        2000 | 25.12859 2.211628 11.36 0.000 20.78714 29.47005
        2001 | 25.19196 2.20767 11.41 0.000 20.85827 29.52564
        2002 | 25.82781 2.211163 11.68 0.000 21.48727 30.16836
        2003 | 26.43671 2.214462 11.94 0.000 22.08969 30.78373
        2004 | 27.16259 2.216933 12.25 0.000 22.81072 31.51446
        2005 | 27.72572 2.210766 12.54 0.000 23.38595 32.06548
        2006 | 28.37921 2.213957 12.82 0.000 24.03318 32.72524
        2007 | 28.81244 2.217603 12.99 0.000 24.45925 33.16563
        2008 | 29.18129 2.210038 13.20 0.000 24.84295 33.51963
        2009 | 30.04636 2.220026 13.53 0.000 25.68842 34.4043
        2010 | 29.84664 2.214024 13.48 0.000 25.50048 34.1928
        2011 | 30.70792 2.221477 13.82 0.000 26.34713 35.06871
        2012 | 30.69942 2.205675 13.92 0.000 26.36965 35.02919
        2013 | 31.45703 2.21553 14.20 0.000 27.10792 35.80615
        2014 | 31.7817 2.208704 14.39 0.000 27.44598 36.11742
        2015 | 31.94043 2.206578 14.48 0.000 27.60888 36.27197
        2016 | 31.93553 2.20639 14.47 0.000 27.60436 36.2667
        2017 | 0 (omitted)
        2018 | 0 (omitted)
        |
        _cons | 46.93884 1.997888 23.49 0.000 43.01696 50.86072
        ---------------+----------------------------------------------------------------
        sigma_u | 14.47667
        sigma_e | 4.742128
        rho | .90309571 (fraction of variance due to u_i)
        --------------------------------------------------------------------------------
        F test that all u_i=0: F(36, 779) = 122.67 Prob > F = 0.0000

        . estimates store FE

        . xtreg flfpr2554 moth_leave_div i.year, re

        Random-effects GLS regression Number of obs = 863
        Group variable: cou_1 Number of groups = 37

        R-sq: Obs per group:
        within = 0.7248 min = 1
        between = 0.1685 avg = 23.3
        overall = 0.3438 max = 47

        Wald chi2(49) = 2063.51
        corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000

        --------------------------------------------------------------------------------
        flfpr2554 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
        ---------------+----------------------------------------------------------------
        moth_leave_div | -2.091913 1.230025 -1.70 0.089 -4.502717 .3188916
        |
        year |
        1971 | -1.274373 2.637807 -0.48 0.629 -6.44438 3.895634
        1972 | -.2522171 2.637999 -0.10 0.924 -5.4226 4.918166
        1973 | 1.563676 2.640024 0.59 0.554 -3.610675 6.738027
        1974 | 2.535105 2.640024 0.96 0.337 -2.639246 7.709457
        1975 | 1.383627 2.567821 0.54 0.590 -3.649211 6.416464
        1976 | 3.521408 2.645178 1.33 0.183 -1.663045 8.705861
        1977 | 3.316154 2.570254 1.29 0.197 -1.721451 8.353759
        1978 | 5.421408 2.645178 2.05 0.040 .2369556 10.60586
        1979 | 4.578655 2.570254 1.78 0.075 -.45895 9.61626
        1980 | 7.962598 2.571095 3.10 0.002 2.923344 13.00185
        1981 | 7.059346 2.513835 2.81 0.005 2.132319 11.98637
        1982 | 9.694341 2.574043 3.77 0.000 4.649309 14.73937
        1983 | 10.65962 2.360452 4.52 0.000 6.033219 15.28602
        1984 | 10.37472 2.355771 4.40 0.000 5.757494 14.99195
        1985 | 11.7242 2.328412 5.04 0.000 7.160592 16.2878
        1986 | 12.80874 2.328624 5.50 0.000 8.244725 17.37276
        1987 | 13.94745 2.328732 5.99 0.000 9.383217 18.51168
        1988 | 15.37164 2.309684 6.66 0.000 10.84474 19.89854
        1989 | 16.15545 2.329865 6.93 0.000 11.589 20.72191
        1990 | 17.9958 2.308818 7.79 0.000 13.4706 22.521
        1991 | 18.89671 2.275146 8.31 0.000 14.43751 23.35592
        1992 | 20.21741 2.260677 8.94 0.000 15.78657 24.64826
        1993 | 20.81997 2.24721 9.26 0.000 16.41552 25.22442
        1994 | 21.29688 2.230682 9.55 0.000 16.92483 25.66894
        1995 | 21.54324 2.241117 9.61 0.000 17.15073 25.93575
        1996 | 21.95469 2.233704 9.83 0.000 17.57671 26.33267
        1997 | 22.55736 2.231643 10.11 0.000 18.18342 26.9313
        1998 | 23.1465 2.232661 10.37 0.000 18.77057 27.52244
        1999 | 23.88423 2.255729 10.59 0.000 19.46308 28.30538
        2000 | 24.99565 2.205555 11.33 0.000 20.67284 29.31846
        2001 | 25.04816 2.201906 11.38 0.000 20.7325 29.36381
        2002 | 25.67641 2.205074 11.64 0.000 21.35455 29.99828
        2003 | 26.27845 2.208067 11.90 0.000 21.95072 30.60619
        2004 | 26.99937 2.210307 12.22 0.000 22.66725 31.3315
        2005 | 27.54106 2.204015 12.50 0.000 23.22127 31.86085
        2006 | 28.18465 2.206865 12.77 0.000 23.85927 32.51002
        2007 | 28.62899 2.210192 12.95 0.000 24.2971 32.96089
        2008 | 28.98081 2.202677 13.16 0.000 24.66364 33.29798
        2009 | 29.85854 2.212387 13.50 0.000 25.52234 34.19474
        2010 | 29.67256 2.206373 13.45 0.000 25.34815 33.99697
        2011 | 30.51754 2.213702 13.79 0.000 26.17876 34.85632
        2012 | 30.48514 2.198 13.87 0.000 26.17714 34.79314
        2013 | 31.25344 2.207542 14.16 0.000 26.92674 35.58014
        2014 | 31.59508 2.20016 14.36 0.000 27.28285 35.90732
        2015 | 31.75739 2.198233 14.45 0.000 27.44893 36.06584
        2016 | 31.75281 2.198063 14.45 0.000 27.44469 36.06093
        2017 | 29.85626 9.548273 3.13 0.002 11.14199 48.57053
        2018 | 35.46734 13.19609 2.69 0.007 9.603477 61.33121
        |
        _cons | 46.50619 2.879482 16.15 0.000 40.86251 52.14987
        ---------------+----------------------------------------------------------------
        sigma_u | 11.986078
        sigma_e | 4.742128
        rho | .86465689 (fraction of variance due to u_i)
        --------------------------------------------------------------------------------

        . estimates store RE

        . hausman FE RE, sigmamore

        Note: the rank of the differenced variance matrix (21) does not equal the number of coefficients being tested (47); be sure this is what you expect, or there may be
        problems computing the test. Examine the output of your estimators for anything unexpected and possibly consider scaling your variables so that the
        coefficients are on a similar scale.

        ---- Coefficients ----
        | (b) (B) (b-B) sqrt(diag(V_b-V_B))
        | FE RE Difference S.E.
        -------------+----------------------------------------------------------------
        moth_leave~v | -2.587295 -2.091913 -.4953823 .4030973
        year |
        1971 | -1.25569 -1.274373 .0186829 .0117485
        1972 | -.2231732 -.2522171 .0290439 .0176482
        1973 | 1.616781 1.563676 .0531053 .0366804
        1974 | 2.588211 2.535105 .0531053 .0366804
        1975 | 1.462541 1.383627 .0789146 .0534386
        1976 | 3.608482 3.521408 .0870744 .0641124
        1977 | 3.408692 3.316154 .0925376 .0643885
        1978 | 5.508483 5.421408 .0870744 .0641124
        1979 | 4.671193 4.578655 .0925376 .0643885
        1980 | 8.059026 7.962598 .0964286 .067443
        1981 | 7.171535 7.059346 .1121897 .0769093
        1982 | 9.804206 9.694341 .1098659 .0782842
        1983 | 10.79261 10.65962 .1329939 .0698665
        1984 | 10.45139 10.37472 .0766739 .0564758
        1985 | 11.78857 11.7242 .0643761 .0470535
        1986 | 12.87454 12.80874 .0657915 .0481296
        1987 | 14.01395 13.94745 .0664991 .048669
        1988 | 15.48295 15.37164 .1113106 .0587444
        1989 | 16.22892 16.15545 .0734699 .0540221
        1990 | 18.06979 17.9958 .073986 .0587035
        1991 | 18.9898 18.89671 .0930881 .0690195
        1992 | 20.31404 20.21741 .0966258 .0724484
        1993 | 20.91492 20.81997 .0949482 .0740046
        1994 | 21.43907 21.29688 .1421873 .0941117
        1995 | 21.65845 21.54324 .1152116 .0916605
        1996 | 22.08714 21.95469 .132451 .1008068
        1997 | 22.68368 22.55736 .1263177 .095939
        1998 | 23.27589 23.1465 .1293844 .0983714
        1999 | 24.03585 23.88423 .1516162 .1160971
        2000 | 25.12859 24.99565 .132944 .1218916
        2001 | 25.19196 25.04816 .1437992 .116152
        2002 | 25.82781 25.67641 .1514014 .1221726
        2003 | 26.43671 26.27845 .1582606 .1276183
        2004 | 27.16259 26.99937 .1632144 .1315584
        2005 | 27.72572 27.54106 .1846561 .1335833
        2006 | 28.37921 28.18465 .1945605 .1391471
        2007 | 28.81244 28.62899 .1834471 .1441581
        2008 | 29.18129 28.98081 .2004812 .1432986
        2009 | 30.04636 29.85854 .1878138 .1476432
        2010 | 29.84664 29.67256 .1740763 .1477479
        2011 | 30.70792 30.51754 .1903824 .1496947
        2012 | 30.69942 30.48514 .2142782 .1479788
        2013 | 31.45703 31.25344 .2035923 .1527139
        2014 | 31.7817 31.59508 .1866187 .1604111
        2015 | 31.94043 31.75739 .1830391 .1576199
        2016 | 31.93553 31.75281 .1827195 .1573709
        ------------------------------------------------------------------------------
        b = consistent under Ho and Ha; obtained from xtreg
        B = inconsistent under Ha, efficient under Ho; obtained from xtreg

        Test: Ho: difference in coefficients not systematic

        chi2(21) = (b-B)'[(V_b-V_B)^(-1)](b-B)
        = 19.29
        Prob>chi2 = 0.5667
        (V_b-V_B is not positive definite)

        .
        end of do-file

        .
        So maybe the problem lies in including year dummies as well as trends? When doing testparm for trends, it does say that I should include them.

        Thank you for your help!

        Comment


        • #5
          Eva:
          with such long T dimension, you should consider -xtgls- or -xtregar- instead of -xtreg-.
          Besides, with such sky-rocketing within and between R-sq in your first -fe- and -re- models are clear signs of overfitting.
          Lastly, it is not clear what is the trend investigated with -i.cou_1#c.t-.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Dear Carlo,

            Thank you for your response!

            The code is wrote for trend is as follows:
            Code:
            * Trends
            
                gen         t=0
                forvalues     year=1970/2018{
                replace     t=`year'-1970 if year==`year'
                }
            and i added the following to the regressions
            Code:
            i.cou_1#c.t
            where cou_1 stands for country!

            Is this correct?

            Thank you for your comment about the long T dimension, this has not come to my mind before. I will investigate the xtgls or xtregar commands!

            Comment


            • #7
              How about xtpcse?

              Comment


              • #8
                Originally posted by Eva Mirre View Post
                How about xtpcse?
                I see that this is for N>T dimensions. Which steps can i take to decide which method (xtreg, xtgls, xtregar) to use?

                Comment


                • #9
                  Eva:
                  a long T dimension increases the need to model the autocrrelation structure (something that cannot be done with -xtreg-).
                  In my opinion, the choice is between -xtgls- and -xtregar-.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Okay thank you, I very much appreciate your advice.

                    I have seen that you can add corr(psar1) to model the autocorrelation structure (exploring xtgls now). Is there a way to estimate whether it follows an AR(1) structure?

                    And what is a good way to estimate the goodness of fit of xtgls?

                    I want to explore whether it is better to include country-specific time trends, or whether i run into the overfitting problem again.

                    Code:
                    xtgls flfpr2554 moth_leave moth_leave_2  i.year i.cou_1 i.cou_1#c.t, i(cou_1) t(year) panels(hetero) corr(psar1) force

                    Thanks again!
                    Last edited by Eva Mirre; 09 Mar 2020, 14:37.

                    Comment


                    • #11
                      Eva:
                      you can test for serial correlation via the community-contributed command -xtserial-, that you can access via -search xtserial- (see also David Drukker's paper on that at https://ageconsearch.umn.edu/record/116069/).
                      Goodness of fit can be checked elaborating a boit on the procedure presented under -linktest- entry in Stata .pdf manual.
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment


                      • #12
                        Thank you, that helps!

                        Comment


                        • #13
                          I am trying to perform the linktest, but it is not possible after xtregar, xtgls or xtreg. Should i perform it simply on reg?

                          Comment


                          • #14
                            Eva:
                            my previous advice was to elaborate on -linktest- procedure, being aware that it cannot be automatically applied after -xtgls-:
                            I do hope that the following toy-example can be helpful:
                            Code:
                            . use "https://www.stata-press.com/data/r16/grunfeld.dta"
                            
                            . xtgls mvalue i.company i.year
                            
                            Cross-sectional time-series FGLS regression
                            
                            Coefficients:  generalized least squares
                            Panels:        homoskedastic
                            Correlation:   no autocorrelation
                            
                            Estimated covariances      =         1          Number of obs     =        200
                            Estimated autocorrelations =         0          Number of groups  =         10
                            Estimated coefficients     =        29          Time periods      =         20
                                                                            Wald chi2(28)     =    4259.12
                            Log likelihood             = -1409.085          Prob > chi2       =     0.0000
                            
                            ------------------------------------------------------------------------------
                                  mvalue |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                            -------------+----------------------------------------------------------------
                                 company |
                                      2  |   -2362.02   87.81172   -26.90   0.000    -2534.128   -2189.912
                                      3  |   -2392.52   87.81172   -27.25   0.000    -2564.628   -2220.412
                                      4  |  -3640.635   87.81172   -41.46   0.000    -3812.743   -3468.527
                                      5  |  -4102.375   87.81172   -46.72   0.000    -4274.483   -3930.267
                                      6  |   -3913.98   87.81172   -44.57   0.000    -4086.088   -3741.872
                                      7  |  -4184.055   87.81172   -47.65   0.000    -4356.163   -4011.947
                                      8  |  -3662.935   87.81172   -41.71   0.000    -3835.043   -3490.827
                                      9  |  -4000.195   87.81172   -45.55   0.000    -4172.303   -3828.087
                                     10  |  -4262.924   87.81172   -48.55   0.000    -4435.032   -4090.816
                                         |
                                    year |
                                   1936  |    372.103   124.1845     3.00   0.003     128.7058    615.5002
                                   1937  |    644.819   124.1845     5.19   0.000     401.4218    888.2162
                                   1938  |    139.671   124.1845     1.12   0.261    -103.7262    383.0682
                                   1939  |    372.783   124.1845     3.00   0.003     129.3858    616.1802
                                   1940  |    426.546   124.1845     3.43   0.001     183.1488    669.9432
                                   1941  |    380.477   124.1845     3.06   0.002     137.0798    623.8742
                                   1942  |    173.375   124.1845     1.40   0.163    -70.02218    416.7722
                                   1943  |    287.693   124.1845     2.32   0.021      44.2958    531.0902
                                   1944  |    320.301   124.1845     2.58   0.010     76.90378    563.6982
                                   1945  |    432.634   124.1845     3.48   0.000     189.2368    676.0312
                                   1946  |    496.493   124.1845     4.00   0.000     253.0958    739.8902
                                   1947  |    219.826   124.1845     1.77   0.077    -23.57121    463.2232
                                   1948  |    189.509   124.1845     1.53   0.127     -53.8882    432.9062
                                   1949  |    210.083   124.1845     1.69   0.091     -33.3142    453.4802
                                   1950  |    269.584   124.1845     2.17   0.030     26.18681    512.9812
                                   1951  |    500.613   124.1845     4.03   0.000     257.2158    744.0102
                                   1952  |    546.911   124.1845     4.40   0.000     303.5138    790.3082
                                   1953  |     770.31   124.1845     6.20   0.000     526.9128    1013.707
                                   1954  |    730.471   124.1845     5.88   0.000     487.0738    973.8682
                                         |
                                   _cons |   3959.635   105.7393    37.45   0.000      3752.39     4166.88
                            ------------------------------------------------------------------------------
                            
                            . predict fitted, xb
                            
                            . g sq_fitted=fitted^2
                            
                            . xtgls mvalue fitted sq_fitted
                            
                            Cross-sectional time-series FGLS regression
                            
                            Coefficients:  generalized least squares
                            Panels:        homoskedastic
                            Correlation:   no autocorrelation
                            
                            Estimated covariances      =         1          Number of obs     =        200
                            Estimated autocorrelations =         0          Number of groups  =         10
                            Estimated coefficients     =         3          Time periods      =         20
                                                                            Wald chi2(2)      =    4541.47
                            Log likelihood             = -1402.946          Prob > chi2       =     0.0000
                            
                            ------------------------------------------------------------------------------
                                  mvalue |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                            -------------+----------------------------------------------------------------
                                  fitted |   .8337266   .0490303    17.00   0.000      .737629    .9298242
                               sq_fitted |   .0000402   .0000113     3.56   0.000      .000018    .0000623
                                   _cons |   66.92904   31.21968     2.14   0.032     5.739598    128.1185
                            ------------------------------------------------------------------------------
                            
                            . test sq_fitted
                            
                             ( 1)  sq_fitted = 0
                            
                                       chi2(  1) =   12.66
                                     Prob > chi2 =    0.0004
                            
                            .
                            The significance of -test- outcome shows evidence of regression misspecification.
                            Kind regards,
                            Carlo
                            (Stata 19.0)

                            Comment


                            • #15
                              Thank you!! That works.

                              Another question (hope that's okay): it is possible to account for heteroscedasticity in the xtregar model?

                              Comment

                              Working...
                              X