Announcement

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

  • Test for significance of Time Dummies

    Hi,

    I am doing a FE and RE Regression and I am not sure if I should use Time Dummies (i.date) or a linear time trend (c.date).

    Code:
    xtreg BEVsalesshare2 $varying $invariant i.date, fe vce(cluster county)
    
    Fixed-effects (within) regression               Number of obs     =      1,296
    Group variable: county                          Number of groups  =         18
    
    R-sq:                                           Obs per group:
         within  = 0.8461                                         min =         72
         between = 0.5139                                         avg =       72.0
         overall = 0.4984                                         max =         72
    
                                                    F(20,17)          =          .
    corr(u_i, Xb)  = -0.8236                        Prob > F          =          .
    
                                    (Std. Err. adjusted for 18 clusters in county)
    ------------------------------------------------------------------------------
                 |               Robust
    BEVsalessh~2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           HOVkm |   .0035468   .0009032     3.93   0.001     .0016412    .0054524
           NTPKM |   1.457356   .5944069     2.45   0.025     .2032672    2.711445
           NFPKM |  -.0001876   .0002327    -0.81   0.431    -.0006786    .0003034
       lCHRoadKm |   .0003344   .0001517     2.20   0.042     .0000143    .0006546
         DGPrice |   1.457764   1.039166     1.40   0.179    -.7346851    3.650213
     EnergyPrice |   .0000216   .0000378     0.57   0.575    -.0000582    .0001015
      Arbeitslos |   .0156132   .0080518     1.94   0.069    -.0013746    .0326009
            AVKT |    .000037   .0000282     1.31   0.207    -.0000225    .0000966
       Einkommen |   7.03e-07   9.98e-07     0.70   0.491    -1.40e-06    2.81e-06
       KuestenKm |          0  (omitted)
        MuMShare |          0  (omitted)
            Temp |          0  (omitted)
                 |
            date |
            613  |  -.2939739   .2121634    -1.39   0.184    -.7415996    .1536518
            614  |  -.9261776   .6646269    -1.39   0.181    -2.328418    .4760626
            615  |  -1.207906    .861059    -1.40   0.179    -3.024582    .6087697
            616  |  -.9949058    .710164    -1.40   0.179    -2.493221    .5034093
            617  |  -1.020068   .7257672    -1.41   0.178    -2.551303    .5111668
            618  |  -1.027555   .7295912    -1.41   0.177    -2.566858    .5117477
            619  |  -.8171673   .5847958    -1.40   0.180    -2.050979    .4166441
            620  |  -.6837897   .4917226    -1.39   0.182    -1.721234    .3536543
            621  |  -.6799051   .4899869    -1.39   0.183    -1.713687    .3538769
            622  |  -.7046242   .5125549    -1.37   0.187     -1.78602    .3767721
            623  |  -.6535136    .470383    -1.39   0.183    -1.645935    .3389078
            624  |  -1.313945   .9263289    -1.42   0.174    -3.268328     .640438
            625  |  -1.623553   1.146794    -1.42   0.175    -4.043077    .7959706
            626  |  -1.858993   1.315581    -1.41   0.176    -4.634626    .9166396
            627  |   -2.22194   1.575141    -1.41   0.176    -5.545197    1.101316
            628  |  -1.514201   1.070677    -1.41   0.175    -3.773132    .7447305
            629  |  -1.019642   .7174562    -1.42   0.173    -2.533342    .4940579
            630  |  -.9345289   .6548755    -1.43   0.172    -2.316195    .4471376
            631  |  -1.403574   .9984869    -1.41   0.178    -3.510197    .7030493
            632  |  -1.823847      1.306    -1.40   0.181    -4.579265    .9315715
            633  |  -1.473502   1.045445    -1.41   0.177    -3.679199    .7321946
            634  |  -.9520076   .6716685    -1.42   0.174    -2.369104     .465089
            635  |  -.7893453   .5522139    -1.43   0.171    -1.954415    .3757241
            636  |  -1.031465   .7057578    -1.46   0.162    -2.520484    .4575538
            637  |  -1.326484   .9191686    -1.44   0.167     -3.26576    .6127924
            638  |  -1.241148   .8566794    -1.45   0.166    -3.048584    .5662872
            639  |  -.8768857   .5970589    -1.47   0.160     -2.13657    .3827985
            640  |  -1.009364    .690045    -1.46   0.162    -2.465231     .446504
            641  |  -1.062054   .7318846    -1.45   0.165    -2.606196    .4820875
            642  |  -1.513326   1.047113    -1.45   0.167     -3.72254    .6958884
            643  |  -1.677617   1.184271    -1.42   0.175    -4.176211    .8209776
            644  |  -1.772249   1.263255    -1.40   0.179    -4.437484    .8929865
            645  |  -1.589766    1.12864    -1.41   0.177    -3.970989    .7914568
            646  |  -1.313958   .9574884    -1.37   0.188    -3.334082     .706166
            647  |   -1.38575   1.006986    -1.38   0.187    -3.510305    .7388046
            648  |  -1.681797   1.192454    -1.41   0.176    -4.197656    .8340617
            649  |  -1.570769   1.127175    -1.39   0.181      -3.9489    .8073629
            650  |  -1.249355   .9409421    -1.33   0.202     -3.23457    .7358591
            651  |  -1.152704   .8185926    -1.41   0.177    -2.879784    .5743752
            652  |  -1.534667   1.093846    -1.40   0.179     -3.84248    .7731458
            653  |  -1.360255    .979134    -1.39   0.183    -3.426047    .7055375
            654  |  -1.759904   1.262651    -1.39   0.181    -4.423864    .9040554
            655  |  -1.617958   1.178995    -1.37   0.188    -4.105421    .8695047
            656  |  -1.393409   .9957378    -1.40   0.180    -3.494232    .7074141
            657  |  -.9588679   .6830983    -1.40   0.178    -2.400079    .4823435
            658  |  -.9905187   .7153963    -1.38   0.184    -2.499873    .5188354
            659  |  -.1240522   .0973825    -1.27   0.220    -.3295112    .0814069
            660  |  -.0512563   .0597748    -0.86   0.403      -.17737    .0748574
            661  |   .3494894   .2271063     1.54   0.142    -.1296629    .8286418
            662  |  -.1340338   .1525497    -0.88   0.392    -.4558856     .187818
            663  |  -.5874017   .4276434    -1.37   0.187     -1.48965     .314847
            664  |   .0913795   .0551258     1.66   0.116    -.0249259    .2076848
            665  |  -.8334221    .621054    -1.34   0.197    -2.143732    .4768874
            666  |  -1.008883   .7212533    -1.40   0.180    -2.530595     .512828
            667  |   .1646014   .0987002     1.67   0.114    -.0436379    .3728406
            668  |   .3036344   .1969627     1.54   0.142    -.1119206    .7191894
            669  |   .4383204   .3030653     1.45   0.166    -.2010915    1.077732
            670  |   .4428938   .3001054     1.48   0.158    -.1902732    1.076061
            671  |    .806903   .5671724     1.42   0.173    -.3897263    2.003532
            672  |   .9135457   .6428917     1.42   0.173    -.4428371    2.269929
            673  |   1.648068   1.173547     1.40   0.178    -.8279002    4.124037
            674  |   .6626571   .4521357     1.47   0.161    -.2912657     1.61658
            675  |   .8644334   .6236019     1.39   0.184    -.4512516    2.180118
            676  |     .95344    .708503     1.35   0.196    -.5413708    2.448251
            677  |   .1065229   .0872987     1.22   0.239    -.0776612    .2907069
            678  |   .0950838   .1061755     0.90   0.383    -.1289269    .3190944
            679  |    .630049   .4534669     1.39   0.183    -.3266824     1.58678
            680  |   .8275755    .573103     1.44   0.167    -.3815662    2.036717
            681  |   .9732132   .7018173     1.39   0.183    -.5074919    2.453918
            682  |   .3737313   .2477754     1.51   0.150    -.1490292    .8964918
            683  |          0  (omitted)
                 |
           _cons |  -19.84632   13.11662    -1.51   0.149    -47.51997    7.827334
    -------------+----------------------------------------------------------------
         sigma_u |  .08053934
         sigma_e |  .02521736
             rho |  .91071741   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    You can see that my individual Time dummies are insignificant, so I wanted to check for the jointly significance of the Time Dummies with a normal F.Test, but I can see that a lot of constraints are dropped.

    What does this mean?

    Is the joint test result still significant and I should therefore use Time dummies instead of a Time Trend?


    Code:
    . testparm i.date
    
     ( 1)  613.date = 0
     ( 2)  614.date = 0
     ( 3)  615.date = 0
     ( 4)  616.date = 0
     ( 5)  617.date = 0
     ( 6)  618.date = 0
     ( 7)  619.date = 0
     ( 8)  620.date = 0
     ( 9)  621.date = 0
     (10)  622.date = 0
     (11)  623.date = 0
     (12)  624.date = 0
     (13)  625.date = 0
     (14)  626.date = 0
     (15)  627.date = 0
     (16)  628.date = 0
     (17)  629.date = 0
     (18)  630.date = 0
     (19)  631.date = 0
     (20)  632.date = 0
     (21)  633.date = 0
     (22)  634.date = 0
     (23)  635.date = 0
     (24)  636.date = 0
     (25)  637.date = 0
     (26)  638.date = 0
     (27)  639.date = 0
     (28)  640.date = 0
     (29)  641.date = 0
     (30)  642.date = 0
     (31)  643.date = 0
     (32)  644.date = 0
     (33)  645.date = 0
     (34)  646.date = 0
     (35)  647.date = 0
     (36)  648.date = 0
     (37)  649.date = 0
     (38)  650.date = 0
     (39)  651.date = 0
     (40)  652.date = 0
     (41)  653.date = 0
     (42)  654.date = 0
     (43)  655.date = 0
     (44)  656.date = 0
     (45)  657.date = 0
     (46)  658.date = 0
     (47)  659.date = 0
     (48)  660.date = 0
     (49)  661.date = 0
     (50)  662.date = 0
     (51)  663.date = 0
     (52)  664.date = 0
     (53)  665.date = 0
     (54)  666.date = 0
     (55)  667.date = 0
     (56)  668.date = 0
     (57)  669.date = 0
     (58)  670.date = 0
     (59)  671.date = 0
     (60)  672.date = 0
     (61)  673.date = 0
     (62)  674.date = 0
     (63)  675.date = 0
     (64)  676.date = 0
     (65)  677.date = 0
     (66)  678.date = 0
     (67)  679.date = 0
     (68)  680.date = 0
     (69)  681.date = 0
     (70)  682.date = 0
           Constraint 1 dropped
           Constraint 2 dropped
           Constraint 3 dropped
           Constraint 4 dropped
           Constraint 5 dropped
           Constraint 6 dropped
           Constraint 7 dropped
           Constraint 8 dropped
           Constraint 10 dropped
           Constraint 11 dropped
           Constraint 12 dropped
           Constraint 13 dropped
           Constraint 14 dropped
           Constraint 16 dropped
           Constraint 17 dropped
           Constraint 18 dropped
           Constraint 19 dropped
           Constraint 20 dropped
           Constraint 21 dropped
           Constraint 22 dropped
           Constraint 23 dropped
           Constraint 24 dropped
           Constraint 25 dropped
           Constraint 26 dropped
           Constraint 27 dropped
           Constraint 28 dropped
           Constraint 29 dropped
           Constraint 30 dropped
           Constraint 31 dropped
           Constraint 32 dropped
           Constraint 34 dropped
           Constraint 35 dropped
           Constraint 36 dropped
           Constraint 37 dropped
           Constraint 39 dropped
           Constraint 40 dropped
           Constraint 41 dropped
           Constraint 45 dropped
           Constraint 47 dropped
           Constraint 54 dropped
           Constraint 55 dropped
           Constraint 56 dropped
           Constraint 57 dropped
           Constraint 58 dropped
           Constraint 59 dropped
           Constraint 62 dropped
           Constraint 63 dropped
           Constraint 64 dropped
           Constraint 66 dropped
           Constraint 69 dropped
    
           F( 20,    17) = 3.5e+06
                Prob > F =    0.0000

    Thanks a lot for your help

    Cheers
    Alex

  • #2
    You only have 18 clusters in your data, and since you are using -vce(cluster)- that gives you only 17 degrees of freedom for tests. But you have far more than 17 time variables, so it is not possible to test them jointly.

    You might want to reconsider whether to use the cluster vce in this model. The cluster robust vce is only valid with a sufficiently large number of clusters. There is no consensus about how many is sufficient, and 18 falls in a grey area that some investigators would say is adequate and others would say is not. If you were to skip using the cluster robust vce, you would be able to do this test.

    That said, hypothesis testing on variables is really not a good way to decide whether they should be included in the model. Particularly when the question is whether to use a linear time trend vs time indicators, this question should be decided either by a good theory of the data generating process that tells you whether the outcome variable drifts in a linear way over time or whether it just bounces around with idiosyncratic shocks from one time period to the next. If there is no theory to go on, do some graphical exploration of outcome vs time and see whether it looks like there is a linear trend or just jumping around. (Based on the results you got I would guess that you won't see much, if anything, in the way of a linear trend and that it's just jumping around.)
    Last edited by Clyde Schechter; 14 Dec 2018, 09:41.

    Comment


    • #3
      Hi Clyde,

      thanks a lot for the explanation. OK ,then I guess I will include both analysis (with and without clustered std. errors) in my thesis. The reason why I chose clustered std. errors is that I've tested the model for heteroskedasticity using the Breusch-Pagan (1979) test, see below. As well I have plotted the residuals and I can see a clear sign for heteroskedasticity (in line with the B-P test).
      Do you agree?


      Code:
       reg BEVsalesshare2 HOVkm NTPKM NFPKM lCHRoadKm DGPrice EnergyPrice Arbeitslos AVKT Einkommen KuestenKm MuM
      > Share Temp 
      
            Source |       SS           df       MS      Number of obs   =     1,296
      -------------+----------------------------------   F(12, 1283)     =    202.81
             Model |  4.32919186        12  .360765988   Prob > F        =    0.0000
          Residual |  2.28227608     1,283  .001778859   R-squared       =    0.6548
      -------------+----------------------------------   Adj R-squared   =    0.6516
             Total |  6.61146794     1,295  .005105381   Root MSE        =    .04218
      
      ------------------------------------------------------------------------------
      BEVsalessh~2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
             HOVkm |  -.0000696   .0002899    -0.24   0.810    -.0006383     .000499
             NTPKM |   .5656652   .0770676     7.34   0.000     .4144729    .7168576
             NFPKM |   .0000148   .0000193     0.76   0.445    -.0000232    .0000527
         lCHRoadKm |    .000972    .000113     8.60   0.000     .0007504    .0011936
           DGPrice |  -.0196511   .0022284    -8.82   0.000    -.0240227   -.0152795
       EnergyPrice |  -.0000684   .0000118    -5.81   0.000    -.0000915   -.0000453
        Arbeitslos |    .034868   .0023238    15.00   0.000     .0303091    .0394269
              AVKT |   .0000148   3.93e-06     3.77   0.000     7.11e-06    .0000225
         Einkommen |   1.10e-06   5.91e-08    18.65   0.000     9.86e-07    1.22e-06
         KuestenKm |   2.03e-06   2.60e-07     7.82   0.000     1.52e-06    2.54e-06
          MuMShare |   .0007303   .0000669    10.92   0.000     .0005992    .0008615
              Temp |   .0012747   .0008112     1.57   0.116    -.0003167    .0028661
             _cons |  -.4990756   .0820384    -6.08   0.000    -.6600198   -.3381314
      ------------------------------------------------------------------------------
      
      . rvfplot, yline(0)
      
      . estat hettest // Breusch-Pagan (1979) version
      
      Breusch-Pagan / Cook-Weisberg test for heteroskedasticity 
               Ho: Constant variance
               Variables: fitted values of BEVsalesshare2
      
               chi2(1)      =   252.73
               Prob > chi2  =   0.0000
      
      .
      Click image for larger version

Name:	Graph.png
Views:	2
Size:	251.4 KB
ID:	1474990


      Regarding the use of time dummies or a linear trend. I have plotted the outcome variable on a monthly basis and to me it is more jumping around than a linear trend... or even an exponential trend?


      Click image for larger version

Name:	outcome variable.png
Views:	1
Size:	234.4 KB
ID:	1474991

      Thanks a lot for your help.

      Regards,
      Alex
      Attached Files

      Comment


      • #4
        Alex:
        as an aside to Clyde's excellen advice, please note that, if -fe- specification is the way to go (by the way, how did you test that hypothesis with clustered standard errors?), using -regress- as a work around is out of debate, as pooled OLS is consistent with the -re- specification only. Moreover, your -regress- code considers the observations as independent, which is not the case given the panel structure of your dataset.
        If you detected heteroskedsticity and/or autocorrelation you're right in invoking cluster-robust standard errors under -xtreg-.
        I share Clyde's point about investigating the existence of a linear time trend; I would also add a quadratic term, just to check whether a turning point exists.
        Eventually, given that you have a T>N panel dataset, -xtreg- should be replaced with -xtregar-.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Carlo,

          the -regress- code above was used to test for heteroskedasticity and not as my main model! Since there is no other way (I am aware of) to test for heteroskedasticity other than using the -regress- (without time dummies) and after that -estat hettest- which gave me the result to reject the H0 of constant variance. -> I think I have to use cluster robust std errors under -xtreg-

          And what do you mean by?:
          (by the way, how did you test that hypothesis with clustered standard errors?)
          Are you wondering how I tested for RE or FE including clustered standard errors?


          I tried investigating about the existence of a linear time trend, see post #3. But I don't know what to do further....
          Can you explain how to add a quadratic time trend? I know that the linear time trend can be added by c.date (in my case).

          Thanks

          Comment


          • #6
            Alex:
            - with such an high number of observations, visual inspection after -xtreg- is enough to suspect/detect heteroskedasticity (that in your case seems to be an issue);
            - my previous reply implied that you cannot test -fe- vs -re- via -hausman- if you impose non-default standard errors (see -search xtoverid- instead);
            - to plug in both linear and squared terms for -timevar-, just type:
            Code:
            c.date##c.date
            ;
            - tthe issue of T>N panel dataset still remains; I would switch from -xtreg- to -xtgregar-.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Hi again,

              thanks for your quick replies!

              - How can I visually inspect the residuals after -xtreg-? I only know the -rvfplot- command which only works after -regress-
              - I am aware of the downwards of Hausman test. Problem with -xtoverrid- is that I was able to include cluster robust std. errors, but not Time dummies (i.date in my case) --> This gave me a significant test result indicating to use of the FE model instead of RE.

              Therefore I also run a manually Auxiliary regression by generating all time averages of all time-varying regressors:
              Code:
              foreach variable of varlist $varying {
                 egen `variable'_mean = mean(`variable'), by (county)
              }
              followed by the Auxiliary regression (including i.date and cluster std. errors)

              Code:
              reg BEVsalesshare2 $varying $invariant *_mean i.date, vce(cluster county)
              Then I ran a joint Wald test:
              Code:
              test HOVkm_mean NTPKM_mean NFPKM_mean lCHRoadKm_mean DGPrice_mean EnergyPrice_mean Arbeitslos_mean AVKT_mean Einkommen_mean
              with the following result:
              Code:
              ( 1)  HOVkm_mean = 0
               ( 2)  NTPKM_mean = 0
               ( 3)  NFPKM_mean = 0
               ( 4)  lCHRoadKm_mean = 0
               ( 5)  o.DGPrice_mean = 0
               ( 6)  EnergyPrice_mean = 0
               ( 7)  Arbeitslos_mean = 0
               ( 8)  AVKT_mean = 0
               ( 9)  Einkommen_mean = 0
                     Constraint 5 dropped
              
                     F(  8,    17) =    2.16
                          Prob > F =    0.0862
              --> This test result is in contrast with the one from -xtoverrid- and states that I cannot reject H0 and therefore RE is more appropriate.
              What do you think about this?

              - I have never heard about -xtregar- command this far. But I can see that I cannot include any time variables there (i.date in my case), so why do you recommend switching to this command?

              Alex

              Comment


              • #8
                Alex:
                1) For the sake of simplicity, let's comapre -xtoverid- and -hausman- outcomes with default standard errrors and -timevar-. As you correctly report, being a buit old-fashioned, the wonderful -xtioverid- does not support the more recent -fvvarlist- notation; the trick is to use the old-fogey -xi:- prefix:
                Code:
                . use "http://www.stata-press.com/data/r15/nlswork.dta"
                (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
                
                . quietly xi: xtreg ln_wage race year, fe
                
                . estimates store fe
                
                . quietly xi: xtreg ln_wage race year, re
                
                . estimates store re
                
                . xtoverid
                
                Test of overidentifying restrictions: fixed vs random effects
                Cross-section time-series model: xtreg re  
                Sargan-Hansen statistic  18.796  Chi-sq(1)    P-value = 0.0000
                
                . hausman fe re
                
                                 ---- Coefficients ----
                             |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
                             |       fe           re         Difference          S.E.
                -------------+----------------------------------------------------------------
                        year |    .0182116     .0186377       -.0004262        .0001006
                ------------------------------------------------------------------------------
                                           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(1) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                                          =       17.96
                                Prob>chi2 =      0.0000
                Now, let's impose cluster/robust standard errors:
                Code:
                . quietly xi: xtreg ln_wage race year, re robust
                
                . xtoverid
                
                Test of overidentifying restrictions: fixed vs random effects
                Cross-section time-series model: xtreg re  robust cluster(idcode)
                Sargan-Hansen statistic  15.474  Chi-sq(1)    P-value = 0.0001
                In both cases, we should go -fe-.

                2) The main issue with your data is that the time-series dimension prevails on tyhe cross-sectional one. The -xtreg- machinery is conceived for short panels (thiose with N>T).
                It's true that -xtregar- does not accept -timevar-among predictors. The idea can be to play the machine around and use, as time predictor a clone of the -timevar- itself:
                Code:
                use http://www.stata-press.com/data/r15/grunfeld
                
                . g alfa=year
                
                . xtset company alfa
                       panel variable:  company (strongly balanced)
                        time variable:  alfa, 1 to 20
                                delta:  1 unit
                
                . xtregar invest mvalue kstock i.year, fe
                
                FE (within) regression with AR(1) disturbances  Number of obs     =        190
                Group variable: company                         Number of groups  =         10
                
                R-sq:                                           Obs per group:
                     within  = 0.6513                                         min =         19
                     between = 0.7838                                         avg =       19.0
                     overall = 0.7798                                         max =         19
                
                                                                F(20,160)         =      14.94
                corr(u_i, Xb)  = -0.1416                        Prob > F          =     0.0000
                
                ------------------------------------------------------------------------------
                      invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                      mvalue |   .0938865   .0104378     8.99   0.000     .0732729    .1145001
                      kstock |   .4076907   .0373936    10.90   0.000      .333842    .4815393
                             |
                        year |
                       1936  |   22.60707   15.23516     1.48   0.140    -7.480873    52.69502
                       1937  |   29.02835   20.63253     1.41   0.161    -11.71886    69.77557
                       1938  |   32.19837   23.69301     1.36   0.176    -14.59298    78.98973
                       1939  |   17.30833   25.51947     0.68   0.499    -33.09011    67.70676
                       1940  |   50.88403   27.01934     1.88   0.061    -2.476513    104.2446
                       1941  |   79.24101   27.76837     2.85   0.005     24.40121    134.0808
                       1942  |   73.97942   28.25514     2.62   0.010      18.1783    129.7805
                       1943  |   56.66199   28.31439     2.00   0.047     .7438482    112.5801
                       1944  |   58.95475   28.56968     2.06   0.041     2.532449     115.377
                       1945  |   49.74642   28.40551     1.75   0.082    -6.351667    105.8445
                       1946  |   75.78518   28.05301     2.70   0.008     20.38324    131.1871
                       1947  |   57.76681   26.94116     2.14   0.034     4.560676    110.9729
                       1948  |   51.01013   26.04522     1.96   0.052    -.4266119    102.4469
                       1949  |   20.19058   24.97134     0.81   0.420    -29.12536    69.50651
                       1950  |   18.35979   23.75434     0.77   0.441     -28.5527    65.27228
                       1951  |   36.28607   21.77871     1.67   0.098    -6.724731    79.29688
                       1952  |   32.36863   18.82811     1.72   0.088    -4.815034    69.55229
                       1953  |   30.71474   14.03026     2.19   0.030     3.006356    58.42313
                       1954  |          0  (omitted)
                             |
                       _cons |  -124.2761   10.59512   -11.73   0.000    -145.2004   -103.3518
                -------------+----------------------------------------------------------------
                      rho_ar |  .68127018
                     sigma_u |  96.029876
                     sigma_e |  39.732352
                     rho_fov |  .85383317   (fraction of variance because of u_i)
                ------------------------------------------------------------------------------
                F test that all u_i=0: F(9,160) = 12.27                      Prob > F = 0.0000
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Alex:
                  as far as visual inspection of residuals after -xtregar- is concerned:
                  Code:
                  . predict res, ue
                  
                  . kdensity res
                  
                  . qnorm res
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Hi Carlo,

                    1) I don't really understand how the -xi:- prefix solves the problem of time dummies....
                    I've tried your example and still I don't see any time dummies here... only a trend variable year? (this variable could also be created with c.year and that's not what I want right?)

                    Code:
                    .  xi: xtreg ln_wage race year, fe
                    note: race omitted because of collinearity
                    
                    Fixed-effects (within) regression               Number of obs     =     28,534
                    Group variable: idcode                          Number of groups  =      4,711
                    
                    R-sq:                                           Obs per group:
                         within  = 0.1022                                         min =          1
                         between = 0.0804                                         avg =        6.1
                         overall = 0.0709                                         max =         15
                    
                                                                    F(1,23822)        =    2712.80
                    corr(u_i, Xb)  = 0.0300                         Prob > F          =     0.0000
                    
                    ------------------------------------------------------------------------------
                         ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                    -------------+----------------------------------------------------------------
                            race |          0  (omitted)
                            year |   .0182116   .0003497    52.08   0.000     .0175262    .0188969
                           _cons |   .2551579   .0273177     9.34   0.000     .2016134    .3087023
                    -------------+----------------------------------------------------------------
                         sigma_u |  .40800642
                         sigma_e |  .30347936
                             rho |  .64380983   (fraction of variance due to u_i)
                    ------------------------------------------------------------------------------
                    F test that all u_i=0: F(4710, 23822) = 8.91                 Prob > F = 0.0000


                    2) Thanks for your example on how to trick -xtregar-. Still, I don't really understand what it does ? -- and how do you add cluster std. errors with -xtregar-?

                    3) Thanks


                    Comment


                    • #11
                      Alex:
                      1) I forgot the -i- before year in my previous example:
                      Code:
                      . use "http://www.stata-press.com/data/r15/nlswork.dta"
                      (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
                      
                      quietly xi: xtreg ln_wage race i.year, fe robust
                      
                      . . estimates store fe
                      
                      . . quietly xi: xtreg ln_wage race i.year, re robust
                      
                      . . estimates store re
                      
                      . xtoverid
                      2) The trick should allow you to estimate the time effect within the same panel. Admittedly, -xtregar- does not allow SE because it focuses on AR1 process, due to the T>N structure of its panel data. -xtgls- and -xtpcse- explicitly consider heteroskeadsticity (and autocorrelation)
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment


                      • #12
                        Carlo,

                        1) I don't know what's happening here but I cannot get it to work with my data (for your example it works).
                        Here's what I did:

                        Code:
                        quietly xi: xtreg BEVsalesshare2 HOVkm NTPKM NFPKM lCHRoadKm DGPrice EnergyPrice Arbeitslos AVKT Einkommen
                        >  KuestenKm MuMShare Temp i.date, fe robust
                        
                        . estimates store fe
                        
                        . quietly xi: xtreg BEVsalesshare2 HOVkm NTPKM NFPKM lCHRoadKm DGPrice EnergyPrice Arbeitslos AVKT Einkommen
                        >  KuestenKm MuMShare Temp i.date, re robust
                        
                        . estimates store re
                        
                        . xtoverid
                        o. operator not allowed
                        r(101);
                        - first of all: I seem to loose date dummies due to collinearity (see below) and I don't understand why. (with the normal -xtreg- without the -xi- it is not the case)

                        Code:
                        .  xi: xtreg BEVsalesshare2 HOVkm NTPKM NFPKM lCHRoadKm DGPrice EnergyPrice Arbeitslos AVKT Einkommen Kueste
                        > nKm MuMShare Temp i.date, fe robust
                        i.date            _Idate_600-695      (naturally coded; _Idate_600 omitted)
                        note: KuestenKm omitted because of collinearity
                        note: MuMShare omitted because of collinearity
                        note: Temp omitted because of collinearity
                        note: _Idate_601 omitted because of collinearity
                        note: _Idate_602 omitted because of collinearity
                        note: _Idate_603 omitted because of collinearity
                        note: _Idate_604 omitted because of collinearity
                        note: _Idate_605 omitted because of collinearity
                        note: _Idate_606 omitted because of collinearity
                        note: _Idate_607 omitted because of collinearity
                        note: _Idate_608 omitted because of collinearity
                        note: _Idate_609 omitted because of collinearity
                        note: _Idate_610 omitted because of collinearity
                        note: _Idate_611 omitted because of collinearity
                        note: _Idate_682 omitted because of collinearity
                        note: _Idate_683 omitted because of collinearity
                        note: _Idate_684 omitted because of collinearity
                        note: _Idate_685 omitted because of collinearity
                        note: _Idate_686 omitted because of collinearity
                        note: _Idate_687 omitted because of collinearity
                        note: _Idate_688 omitted because of collinearity
                        note: _Idate_689 omitted because of collinearity
                        note: _Idate_690 omitted because of collinearity
                        note: _Idate_691 omitted because of collinearity
                        note: _Idate_692 omitted because of collinearity
                        note: _Idate_693 omitted because of collinearity
                        note: _Idate_694 omitted because of collinearity
                        note: _Idate_695 omitted because of collinearity
                        
                        Fixed-effects (within) regression               Number of obs     =      1,296
                        Group variable: county                          Number of groups  =         18
                        
                        R-sq:                                           Obs per group:
                             within  = 0.8461                                         min =         72
                             between = 0.5139                                         avg =       72.0
                             overall = 0.4984                                         max =         72
                        
                                                                        F(17,17)          =          .
                        corr(u_i, Xb)  = -0.8236                        Prob > F          =          .
                        
                                                        (Std. Err. adjusted for 18 clusters in county)
                        ------------------------------------------------------------------------------
                                     |               Robust
                        BEVsalessh~2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                        -------------+----------------------------------------------------------------
                               HOVkm |   .0035468   .0009032     3.93   0.001     .0016412    .0054524
                               NTPKM |   1.457356   .5944068     2.45   0.025     .2032673    2.711445
                               NFPKM |  -.0001876   .0002327    -0.81   0.431    -.0006786    .0003034
                           lCHRoadKm |   .0003344   .0001517     2.20   0.042     .0000143    .0006546
                             DGPrice |  -.0994497   .0331268    -3.00   0.008    -.1693411   -.0295582
                         EnergyPrice |   .0000216   .0000378     0.57   0.575    -.0000582    .0001015
                          Arbeitslos |   .0156132   .0080518     1.94   0.069    -.0013746    .0326009
                                AVKT |    .000037   .0000282     1.31   0.207    -.0000225    .0000966
                           Einkommen |   7.03e-07   9.98e-07     0.70   0.491    -1.40e-06    2.81e-06
                           KuestenKm |          0  (omitted)
                            MuMShare |          0  (omitted)
                                Temp |          0  (omitted)
                          _Idate_601 |          0  (omitted)
                          _Idate_602 |          0  (omitted)
                          _Idate_603 |          0  (omitted)
                          _Idate_604 |          0  (omitted)
                          _Idate_605 |          0  (omitted)
                          _Idate_606 |          0  (omitted)
                          _Idate_607 |          0  (omitted)
                          _Idate_608 |          0  (omitted)
                          _Idate_609 |          0  (omitted)
                          _Idate_610 |          0  (omitted)
                          _Idate_611 |          0  (omitted)
                          _Idate_612 |  -.0934328   .0619434    -1.51   0.150    -.2241219    .0372563
                          _Idate_613 |  -.0681779    .062751    -1.09   0.292    -.2005709    .0642151
                          _Idate_614 |  -.0229936   .0685358    -0.34   0.741    -.1675914    .1216042
                          _Idate_615 |  -.0088514   .0700164    -0.13   0.901    -.1565732    .1388704
                          _Idate_616 |  -.0216471   .0675063    -0.32   0.752    -.1640729    .1207786
                          _Idate_617 |  -.0234514   .0676963    -0.35   0.733     -.166278    .1193753
                          _Idate_618 |  -.0231524   .0662402    -0.35   0.731     -.162907    .1166022
                          _Idate_619 |  -.0307743   .0652927    -0.47   0.643    -.1685299    .1069813
                          _Idate_620 |   -.037546   .0646474    -0.58   0.569      -.17394    .0988481
                          _Idate_621 |  -.0336613   .0641663    -0.52   0.607    -.1690404    .1017178
                          _Idate_622 |  -.0272362   .0649467    -0.42   0.680    -.1642617    .1097893
                          _Idate_623 |  -.0384142   .0639221    -0.60   0.556    -.1732779    .0964496
                          _Idate_624 |   .0019005   .0590657     0.03   0.975    -.1227173    .1265182
                          _Idate_625 |   .0193072   .0665318     0.29   0.775    -.1210627     .159677
                          _Idate_626 |   .0408079   .0654495     0.62   0.541    -.0972785    .1788943
                          _Idate_627 |   .0671638   .0710951     0.94   0.358    -.0828337    .2171614
                          _Idate_628 |   .0196548   .0601353     0.33   0.748    -.1072196    .1465292
                          _Idate_629 |  -.0152394   .0549266    -0.28   0.785    -.1311243    .1006456
                          _Idate_630 |  -.0235588   .0537298    -0.44   0.667    -.1369187    .0898011
                          _Idate_631 |   .0212767   .0596946     0.36   0.726    -.1046679    .1472212
                          _Idate_632 |   .0603821   .0663183     0.91   0.375    -.0795374    .2003015
                          _Idate_633 |    .021423   .0605377     0.35   0.728    -.1063003    .1491463
                          _Idate_634 |  -.0176793   .0547392    -0.32   0.751     -.133169    .0978104
                          _Idate_635 |  -.0340966   .0534923    -0.64   0.532    -.1469555    .0787622
                          _Idate_636 |  -.0192761   .0390972    -0.49   0.628     -.101764    .0632118
                          _Idate_637 |    .004934   .0441517     0.11   0.912    -.0882181     .098086
                          _Idate_638 |  -.0031633   .0431512    -0.07   0.942    -.0942044    .0878779
                          _Idate_639 |  -.0282042   .0382798    -0.74   0.471    -.1089675    .0525592
                          _Idate_640 |  -.0205329   .0395224    -0.52   0.610    -.1039178    .0628521
                          _Idate_641 |  -.0109347   .0407038    -0.27   0.791    -.0968122    .0749428
                          _Idate_642 |   .0127437   .0459285     0.28   0.785     -.084157    .1096443
                          _Idate_643 |   .0508906   .0513784     0.99   0.336    -.0575082    .1592895
                          _Idate_644 |   .0730495   .0522959     1.40   0.180    -.0372853    .1833843
                          _Idate_645 |   .0530946    .050701     1.05   0.310     -.053875    .1600643
                          _Idate_646 |   .0719625   .0468665     1.54   0.143    -.0269172    .1708421
                          _Idate_647 |   .0780306   .0448922     1.74   0.100    -.0166837    .1727448
                          _Idate_648 |   .0778547   .0421444     1.85   0.082    -.0110623    .1667717
                          _Idate_649 |    .087664   .0419919     2.09   0.052    -.0009313    .1762592
                          _Idate_650 |    .128779   .0376518     3.42   0.003     .0493406    .2082174
                          _Idate_651 |   .0463503   .0328113     1.41   0.176    -.0228754     .115576
                          _Idate_652 |   .0770493   .0391701     1.97   0.066    -.0055925    .1596911
                          _Idate_653 |   .0801682   .0347023     2.31   0.034     .0069526    .1533837
                          _Idate_654 |   .1087521   .0433061     2.51   0.022     .0173843    .2001199
                          _Idate_655 |   .1183353   .0447323     2.65   0.017     .0239584    .2127123
                          _Idate_656 |    .070372   .0397738     1.77   0.095    -.0135434    .1542875
                          _Idate_657 |   .0377489   .0310179     1.22   0.240    -.0276932    .1031911
                          _Idate_658 |   .0528145   .0319044     1.66   0.116    -.0144979     .120127
                          _Idate_659 |  -.0072611   .0221002    -0.33   0.747    -.0538885    .0393662
                          _Idate_660 |   .0266044   .0121931     2.18   0.043     .0008793    .0523295
                          _Idate_661 |  -.0008837   .0155677    -0.06   0.955    -.0337286    .0319613
                          _Idate_662 |   .0839761   .0127352     6.59   0.000     .0571073     .110845
                          _Idate_663 |   .0432699   .0164152     2.64   0.017     .0086369     .077903
                          _Idate_664 |  -.0020534   .0121236    -0.17   0.868    -.0276319    .0235252
                          _Idate_665 |   .0853341   .0206006     4.14   0.001     .0418706    .1287975
                          _Idate_666 |    .065594   .0252981     2.59   0.019     .0122197    .1189684
                          _Idate_667 |     .00888   .0141383     0.63   0.538    -.0209492    .0387092
                          _Idate_668 |  -.0000223   .0174539    -0.00   0.999    -.0368469    .0368023
                          _Idate_669 |  -.0210577   .0146531    -1.44   0.169     -.051973    .0098576
                          _Idate_670 |  -.0164843   .0146352    -1.13   0.276     -.047362    .0143933
                          _Idate_671 |  -.0495646    .020695    -2.40   0.028    -.0932273    -.005902
                          _Idate_672 |  -.0519268   .0227217    -2.29   0.035    -.0998655   -.0039881
                          _Idate_673 |  -.1115834   .0375474    -2.97   0.009    -.1908016   -.0323652
                          _Idate_674 |  -.0147309   .0172368    -0.85   0.405    -.0510972    .0216355
                          _Idate_675 |  -.0698949   .0206623    -3.38   0.004    -.1134886   -.0263012
                          _Idate_676 |  -.1054654   .0234522    -4.50   0.000    -.1549453   -.0559856
                          _Idate_677 |  -.0180542   .0082928    -2.18   0.044    -.0355505   -.0005579
                          _Idate_678 |  -.0606376   .0084616    -7.17   0.000      -.07849   -.0427853
                          _Idate_679 |   -.047339   .0152066    -3.11   0.006    -.0794221   -.0152559
                          _Idate_680 |  -.0288921   .0195494    -1.48   0.158    -.0701377    .0123534
                          _Idate_681 |  -.0779062   .0229521    -3.39   0.003    -.1263308   -.0294815
                          _Idate_682 |          0  (omitted)
                          _Idate_683 |          0  (omitted)
                          _Idate_684 |          0  (omitted)
                          _Idate_685 |          0  (omitted)
                          _Idate_686 |          0  (omitted)
                          _Idate_687 |          0  (omitted)
                          _Idate_688 |          0  (omitted)
                          _Idate_689 |          0  (omitted)
                          _Idate_690 |          0  (omitted)
                          _Idate_691 |          0  (omitted)
                          _Idate_692 |          0  (omitted)
                          _Idate_693 |          0  (omitted)
                          _Idate_694 |          0  (omitted)
                          _Idate_695 |          0  (omitted)
                               _cons |   .5064686   .8400738     0.60   0.555    -1.265932    2.278869
                        -------------+----------------------------------------------------------------
                             sigma_u |  .08053934
                             sigma_e |  .02521736
                                 rho |  .91071741   (fraction of variance due to u_i)
                        ------------------------------------------------------------------------------
                        - and second: the -xtoverid- doesn't work anymore (maybe due to the error before?)

                        2) Alright. My problem is that my dataset suffers from autocorrelation, as well as heteroskedasticity. Do I understand it correctly that the -xtregar- only corrects for autocorrelation and is therefore not good for my date (T>N) and that you suggest -xtgls- and -xtpcse-?

                        Comment


                        • #13
                          Alex:
                          1) very strange indeed. Usually, I get the same omitted variable due to collinearity.
                          Your diagnosis about -xtoverid- error message is correct. There's a quite old Stata thread on this topic, but I fear iis too cumbersome to aplly to your code:https://www.stata.com/statalist/arch...msg00833.html;
                          2) you may want to consider -xtgls- with a categorical variable as predictot for -i.county- (instead than a -i.time-). -xtgls- can accomodate both autocorrelation and heteroskedasticity with dedicated options.
                          Kind regards,
                          Carlo
                          (Stata 19.0)

                          Comment


                          • #14
                            Carlo:

                            1) hmm...do you know another way to test for FE or RE including robust std. errors and time dummies? My approach with a Wald test on all time averages of all time-varying regressors results in RE (incl. cluster robust std. errors and time dummies) and in FE (only time dummies but no cluster robust std. errors).

                            2) I thought of using something like this
                            Code:
                            . xtgls BEVsalesshare2 $varying $invariant i.date, panels(hetero) corr(ar1)
                            note: 683.date omitted because of collinearity
                            
                            Cross-sectional time-series FGLS regression
                            
                            Coefficients:  generalized least squares
                            Panels:        heteroskedastic
                            Correlation:   common AR(1) coefficient for all panels  (0.6681)
                            
                            Estimated covariances      =        18          Number of obs     =      1,296
                            Estimated autocorrelations =         1          Number of groups  =         18
                            Estimated coefficients     =        83          Time periods      =         72
                                                                            Wald chi2(82)     =    2595.61
                                                                            Prob > chi2       =     0.0000
                            
                            ------------------------------------------------------------------------------
                            BEVsalessh~2 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                            -------------+----------------------------------------------------------------
                                   HOVkm |   .0015247   .0004277     3.56   0.000     .0006863    .0023631
                                   NTPKM |   .2252295   .1147146     1.96   0.050      .000393     .450066
                                   NFPKM |   .0000462   .0000205     2.26   0.024     6.04e-06    .0000863
                               lCHRoadKm |   .0005126   .0002087     2.46   0.014     .0001035    .0009218
                                 DGPrice |    1.53958   .2188946     7.03   0.000     1.110554    1.968605
                             EnergyPrice |  -6.07e-06   .0000239    -0.25   0.799    -.0000529    .0000408
                              Arbeitslos |   .0153191   .0028753     5.33   0.000     .0096836    .0209547
                                    AVKT |   .0000184   5.38e-06     3.42   0.001     7.84e-06    .0000289
                               Einkommen |   3.42e-07   9.81e-08     3.49   0.000     1.50e-07    5.35e-07
                               KuestenKm |   1.68e-06   3.93e-07     4.28   0.000     9.10e-07    2.45e-06
                                MuMShare |   .0004653   .0000908     5.13   0.000     .0002874    .0006432
                                    Temp |   .0063341   .0012288     5.15   0.000     .0039257    .0087426
                                         |
                                    date |
                                    613  |  -.3176895   .0412696    -7.70   0.000    -.3985765   -.2368026
                                    614  |  -.9848912   .1360999    -7.24   0.000    -1.251642   -.7181404
                                    615  |  -1.281226   .1768548    -7.24   0.000    -1.627855   -.9345966
                                    616  |  -1.058508   .1440269    -7.35   0.000    -1.340796   -.7762206
                                    617  |  -1.084492   .1469281    -7.38   0.000    -1.372465    -.796518
                                    618  |  -1.095114    .145945    -7.50   0.000    -1.381161   -.8090672
                                    619  |  -.8745847   .1150781    -7.60   0.000    -1.100134   -.6490358
                                    620  |   -.733017   .0963248    -7.61   0.000    -.9218102   -.5442238
                                    621  |  -.7348754    .092371    -7.96   0.000    -.9159194   -.5538315
                                    622  |  -.7554864   .1000637    -7.55   0.000    -.9516077   -.5593652
                                    623  |  -.7023329   .0909203    -7.72   0.000    -.8805335   -.5241324
                                    624  |  -1.395064   .1884671    -7.40   0.000    -1.764453   -1.025675
                                    625  |  -1.715536   .2391412    -7.17   0.000    -2.184244   -1.246828
                                    626  |  -1.972167   .2703103    -7.30   0.000    -2.501965   -1.442368
                                    627  |  -2.357983   .3243859    -7.27   0.000    -2.993768   -1.722198
                                    628  |  -1.609486   .2178175    -7.39   0.000    -2.036401   -1.182572
                                    629  |  -1.088155   .1437807    -7.57   0.000     -1.36996   -.8063504
                                    630  |  -.9962486   .1303327    -7.64   0.000    -1.251696   -.7408011
                                    631  |  -1.498822   .2009487    -7.46   0.000    -1.892674    -1.10497
                                    632  |  -1.942876   .2669882    -7.28   0.000    -2.466163   -1.419589
                                    633  |  -1.568519   .2129806    -7.36   0.000    -1.985954   -1.151085
                                    634  |  -1.016154   .1349004    -7.53   0.000    -1.280554   -.7517541
                                    635  |  -.8410136   .1109178    -7.58   0.000    -1.058408   -.6236187
                                    636  |   -1.09783   .1449468    -7.57   0.000     -1.38192   -.8137393
                                    637  |  -1.410609   .1904946    -7.40   0.000    -1.783972   -1.037246
                                    638  |  -1.318225   .1776237    -7.42   0.000    -1.666361   -.9700885
                                    639  |  -.9310263   .1238929    -7.51   0.000    -1.173852   -.6882006
                                    640  |  -1.072604   .1429091    -7.51   0.000      -1.3527   -.7925072
                                    641  |  -1.131314   .1508733    -7.50   0.000     -1.42702    -.835608
                                    642  |  -1.603682    .217259    -7.38   0.000    -2.029502   -1.177863
                                    643  |  -1.782499   .2461116    -7.24   0.000    -2.264869   -1.300129
                                    644  |   -1.88511    .262415    -7.18   0.000    -2.399434   -1.370786
                                    645  |  -1.689431   .2347787    -7.20   0.000    -2.149589   -1.229274
                                    646  |   -1.40595   .1980052    -7.10   0.000    -1.794033   -1.017867
                                    647  |  -1.479543   .2094076    -7.07   0.000    -1.889974   -1.069111
                                    648  |  -1.795469   .2494823    -7.20   0.000    -2.284446   -1.306493
                                    649  |  -1.678916   .2358069    -7.12   0.000    -2.141089   -1.216743
                                    650  |  -1.347091   .1961319    -6.87   0.000    -1.731502   -.9626793
                                    651  |   -1.23301   .1706759    -7.22   0.000    -1.567529   -.8984912
                                    652  |  -1.637812   .2278341    -7.19   0.000    -2.084359   -1.191265
                                    653  |  -1.454103   .2034762    -7.15   0.000    -1.852909   -1.055297
                                    654  |  -1.874713   .2645155    -7.09   0.000    -2.393154   -1.356272
                                    655  |  -1.726562   .2463829    -7.01   0.000    -2.209464    -1.24366
                                    656  |  -1.486773   .2083411    -7.14   0.000    -1.895114   -1.078432
                                    657  |   -1.02834   .1428743    -7.20   0.000    -1.308368   -.7483112
                                    658  |  -1.063779   .1479262    -7.19   0.000    -1.353709   -.7738493
                                    659  |  -.1442573   .0206613    -6.98   0.000    -.1847527    -.103762
                                    660  |   -.071215   .0150801    -4.72   0.000    -.1007715   -.0416585
                                    661  |   .3528022    .047719     7.39   0.000     .2592746    .4463298
                                    662  |  -.1609771   .0329406    -4.89   0.000    -.2255394   -.0964148
                                    663  |   -.628675   .0902109    -6.97   0.000    -.8054851   -.4518649
                                    664  |   .0811148   .0148261     5.47   0.000     .0520561    .1101734
                                    665  |   -.895318   .1297407    -6.90   0.000    -1.149605   -.6410309
                                    666  |  -1.079883   .1510515    -7.15   0.000    -1.375938   -.7838273
                                    667  |   .1550646   .0249173     6.22   0.000     .1062276    .2039016
                                    668  |   .3011359    .044328     6.79   0.000     .2142546    .3880172
                                    669  |    .450916   .0655806     6.88   0.000     .3223803    .5794516
                                    670  |   .4559774   .0636533     7.16   0.000     .3312193    .5807355
                                    671  |    .841219   .1195364     7.04   0.000      .606932    1.075506
                                    672  |   .9494684   .1359367     6.98   0.000     .6830374    1.215899
                                    673  |   1.726945   .2471776     6.99   0.000     1.242486    2.211405
                                    674  |   .6870768   .0950597     7.23   0.000     .5007633    .8733904
                                    675  |   .9034216   .1307941     6.91   0.000     .6470698    1.159773
                                    676  |   1.006063    .147997     6.80   0.000     .7159938    1.296131
                                    677  |   .1072453   .0185974     5.77   0.000      .070795    .1436957
                                    678  |   .0961742   .0226108     4.25   0.000     .0518579    .1404904
                                    679  |   .6577877   .0948192     6.94   0.000     .4719455    .8436299
                                    680  |   .8627259   .1204354     7.16   0.000     .6266768    1.098775
                                    681  |    1.02473   .1474458     6.95   0.000      .735741    1.313718
                                    682  |   .3921202   .0516955     7.59   0.000     .2907989    .4934414
                                    683  |          0  (omitted)
                                         |
                                   _cons |    -20.504   2.849867    -7.19   0.000    -26.08963   -14.91836
                            ------------------------------------------------------------------------------
                            why do you recommend the i.county instead of the i.date? I mean under -xtreg- the i.county is already specified by setting the panel with -xtset-, is this different under -xtgls-?

                            Comment


                            • #15
                              Alex:
                              1) No, unfortunately. The literature and related methodological aopproaches to deal with T>N panel datasets are probably less developed than the ones conceived for N>T panel datasets (as microeconometrics interests many more research fields, even far from economics).
                              2) your -xtgls- regression makes sense;
                              3) since in T>N panel datasets the time-series dimension is pretty long, you would be better off with replacing a categorical -i.date- with a continuos -c.date-, checking via a quadratic term whether a turning point is included in your data. By adding -i.county- you can estimate an individual effect related to you cross-sectional dimension.
                              For more details, I refer you to https://www.stata.com/bookstore/micr...metrics-stata/, pages 271-279.
                              Kind regards,
                              Carlo
                              (Stata 19.0)

                              Comment

                              Working...
                              X