Announcement

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

  • Stationarity test panel data N>T

    Hello everybody,

    I have a balanced panel dataset where N=27 and T=20.

    I checked the -xtunitroot- pages of the manual but is not clear to me which test fits the characteristics of my dataset. Could you help me?

    Also, since this is one of the test that I will do before regress the variables (still have to choose among -xtreg-, -xtgls-, etc.), in the case of non-stationarity can I use the differences (d.x) to carry out the analysis?

    I hope I have not violated any forum rules, this is my first post.

    Thank you

  • #2
    Hello!
    I am having the same problem, I have a balance data where N=115 and T=5. What test did you use?
    I was trying to do the Levin Lin Chiu test but I get an error message saying I have no observations.

    Comment


    • #3
      See https://www.reddit.com/r/stata/comme...a_is_complete/ for the same problem, perhaps as an undeclared cross-posting.

      See https://www.statalist.org/forums/for...balanced-panel for the same question. Please don't run simultaneous threads with the same question.
      Last edited by Nick Cox; 24 Apr 2023, 16:53.

      Comment


      • #4
        Thank you! Maybe do you know what is the problem?

        Comment


        • #5
          Yes. See the Reddit thread and your other thread, where the explanation that your dataset is too small is given.

          This is why cross-posting without telling us can be a nuisance and is specifically advised against in our FAQ and also on Reddit: it leads to duplication of effort.

          Comment


          • #6
            I am sorry, this was my first post, so I am still trying to see how everything works. But again, thank you!

            Comment


            • #7
              Hey, please post your dataset Andres Vinueza using dataex, per your reddit question.

              Comment


              • #8
                I get
                . dataex
                input statement exceeds linesize limit. Try specifying fewer variables
                r(1000);


                Sorry to ask, I am new to dataex

                Comment


                • #9
                  Then include the first 5 variables of your dataset, whatever they are. And do
                  Code:
                  dataex [varlist], count(115)

                  Comment


                  • #10

                    Code:
                    * Example generated by -dataex-. For more info, type help dataex
                    clear
                    input str24 Country int Year double(Trade_to_GDP AvgYearsofTotalSchooling rgdpna) long(FixedtelephonesubscriptionsI Population) double(Deathrate FDI)
                    "Albania"                  1995 47.6105948729712  9.564      13572.9453125     42150    3187784  5.549      2.925485966576154
                    "Albania"                  2000 63.4540743986735 10.139       17348.265625    152687    3089027  5.798      4.108775955259288
                    "Albania"                  2005 70.8723282677903 10.333      23076.5546875    278973    3011487  6.306     3.2597691930376453
                    "Albania"                  2010 76.5433552386804 10.137      29844.1796875    333066    2913021  7.029      9.138134145758569
                    "Albania"                  2015 71.8010303683204 10.724     32612.73046875    226718    2880703  7.947      8.690536219803818
                    "Algeria"                  1995 55.1910052081435    7.7      221803.234375   1176316   28478022   5.69 2.3943885876927807e-06
                    "Algeria"                  2000 62.8637951105937   7.27       262814.65625   1761327   30774621  5.037      .5112210114965051
                    "Algeria"                  2005 71.2774398307326  7.549       338474.34375   2572000   32956690  4.943      1.120174319332021
                    "Algeria"                  2010 69.8675717597612  8.236       383637.15625   2922731   35856344  4.754     1.4269636360164346
                    "Algeria"                  2015 59.6950803585319  9.302          451674.75   3267592   39543154  4.437    -.32401208350178407
                    "Argentina"                1995      19.77142309   9.37        595788.8125   5714158   34946110  7.535     2.1739275897499706
                    "Argentina"                2000      22.62244478  9.281        676603.6875   7894205   37070774    7.6     3.6657905953537906
                    "Argentina"                2005      40.55127097    9.8             744411   9441673   39070501  7.423      2.649354414521665
                    "Argentina"                2010      34.97101326 10.599        945250.5625   9914208   40788453  7.661      2.675161718865369
                    "Argentina"                2015      22.48622609  11.11         1017094.75  10073125   43131966  7.543     1.9771346178442624
                    "Armenia"                  1995 86.1148570667578 10.388    10206.708984375    582800    3322782  7.969     1.7244227571625588
                    "Armenia"                  2000 73.9185192676351  9.329      13107.6015625    533387    3168523   8.27     5.4504331557356105
                    "Armenia"                  2005 72.0389566828983   9.63    23699.517578125    594404    3047246  8.914      5.960106339583573
                    "Armenia"                  2010 66.1473098093357  9.833    28638.705078125    592300    2946293  9.384      5.716037845460043
                    "Armenia"                  2015 71.5932653468932  10.44         35484.4375    551366    2878595  9.607      1.744736992413284
                    "Australia"                1995      37.80155166 10.777         650565.875   8900000   18004882    6.9     3.6042937765558376
                    "Australia"                2000      41.02901118 10.326           787359.5  10050000   19028802    6.7      3.581323117721559
                    "Australia"                2005      39.27118264 10.843          930942.25  10120000   20176844    6.4    -3.6088180824292118
                    "Australia"                2010      40.64967173 12.755        1068298.625  10625000   22031750    6.5      3.065508043110022
                    "Australia"                2015      41.49437308 12.851        1226367.125   8500000   23815995    6.6      3.471957926434086
                    "Austria"                  1995       68.2566011  8.695           308509.5   3796900    7948278   10.2      .7571785815588744
                    "Austria"                  2000      85.36049562  8.841       357462.09375   3997000    8011566    9.6      4.308900394829944
                    "Austria"                  2005      94.03380568  8.557       390156.96875   3739000    8227829    9.1      25.65582783078723
                    "Austria"                  2010      99.01979624  8.336         416311.125   3398000    8363404    9.2     -5.610176314798762
                    "Austria"                  2015      102.4273154  8.378         438764.625   3609900    8642699    9.6      -2.08805653898309
                    "Bahrain"                  1995 152.464315379845  8.563     26970.21484375    140850     612934  2.896      7.361126807382622
                    "Bahrain"                  2000 135.809135327865  8.832      33888.0703125    170976     711442  2.595      4.011545582349192
                    "Bahrain"                  2005 148.313525108923  8.364     43582.00390625    193520     901921  2.308      6.566594458402294
                    "Bahrain"                  2010 120.472394522656  8.321     57115.65234375    228000    1213645  1.883      .6058000457977667
                    "Bahrain"                  2015 154.067261198309  8.263        68366.71875    280115    1362142  2.109     .20899285998163605
                    "Bangladesh"               1995      28.20949608  4.489       186624.15625    286605  117793338  9.496     .00499837818821928
                    "Bangladesh"               2000      29.32171436  6.582      240567.828125    491303  129193327  6.855      .5253620892360888
                    "Bangladesh"               2005      34.39693486  7.892           313404.5   1070000  140912590  6.425      1.171208960466686
                    "Bangladesh"               2010      37.80284267  8.386        420619.6875   1280782  148391139  6.106     1.0689348611106355
                    "Bangladesh"               2015      42.08599631  9.009        571495.5625    864263  157830000  5.776     1.4512876466367808
                    "Barbados"                 1995 90.0714364215848  9.341  2598.416259765625     90132     262303  9.863      2.877965523137362
                    "Barbados"                 2000 88.7794329649207  9.426    3076.0732421875    123832     264657   9.47      2.408790452851773
                    "Barbados"                 2005 95.6675134067175  9.886  3260.594482421875    134878     269477  9.218     10.212368002730726
                    "Barbados"                 2010 95.9103767713056 10.081     3288.888671875    137486     274711  9.037      9.389493263833778
                    "Barbados"                 2015 84.3435710506825 10.599  3280.442626953125    149532     278083  8.772     14.572930042689459
                    "Belgium"                  1995      116.3785678 11.136       344239.84375   4682086   10136811   10.3     3.7110244473466794
                    "Belgium"                  2000      142.2301351 10.938       396405.15625   5036422   10251250   10.2      37.47531229790867
                    "Belgium"                  2005      144.5290507 10.258        436446.0625   4794583   10478617    9.9      8.727177201864627
                    "Belgium"                  2010      149.9976731 10.106       469779.15625   4639780   10895586    9.7      26.06698199624618
                    "Belgium"                  2015      154.1925465 10.467        501096.4375   4488711   11274196    9.8      -4.22079695282357
                    "Belize"                   1995 97.0720178849822  9.949 1050.0250244140625     28947     203556  5.448        2.5717776420281
                    "Belize"                   2000 126.645263882971  9.908   1406.48095703125     35754     240406  5.858      2.649162358124247
                    "Belize"                   2005 117.355392335703 10.458  1801.095947265625     33770     280375   5.51      8.683439337807936
                    "Belize"                   2010 117.702232172801 10.746 2027.1275634765625     30288     322106   4.66      5.547879038470135
                    "Belize"                   2015 125.077873793669 10.895  2284.763427734375     23603     359871    4.7     2.6744729200700657
                    "Bolivia"                  1995       49.7379857  9.398     37366.41796875    246881    7841471 10.625      5.847909250423938
                    "Bolivia"                  2000      45.59777511 10.133       44253.515625    510755    8592656  9.826      8.768250416807309
                    "Bolivia"                  2005      67.64194249 10.135     51525.94921875    646291    9377388  8.554    -2.4988800178579567
                    "Bolivia"                  2010      75.51162599  9.173     64502.35546875    851203   10223270   7.66     3.1654435637675076
                    "Bolivia"                  2015      67.93284494  9.501      84245.3671875    881235   11090085  7.216      1.680727879642806
                    "Botswana"                 1995      94.59517165 10.666    13712.474609375     59673    1543634 10.596     1.4884593080670414
                    "Botswana"                 2000      91.92472969 10.734    17660.513671875    135900    1726985 13.128      .9877001693962422
                    "Botswana"                 2005      88.50535206 10.611    21099.220703125    136463    1892807 12.568      4.242949051008693
                    "Botswana"                 2010      94.89979632 10.553     26369.80859375    137422    2091664   8.93     1.7280549888587091
                    "Botswana"                 2015      107.5243913 10.784      33298.7890625    160490    2305171  7.435     2.7977348842039307
                    "Brazil"                   1995         16.98446  7.394          1815769.5  13263000  163515328  6.685      .6315857909601483
                    "Brazil"                   2000      22.63976136  8.378         2005781.25  30926272  175873720  6.399     5.0339171412586055
                    "Brazil"                   2005      27.08679521  8.921          2300215.5  39852600  186797334  6.106     1.7339006686040621
                    "Brazil"                   2010      22.77217811  8.459         2862790.75  42141418  196353492  6.199     3.7299556363858066
                    "Brazil"                   2015      26.95364262  8.192         3029301.75  43677141  205188205  6.433     3.5921449988242156
                    "Brunei Darussalam"        1995 115.543964232489  7.859    22720.068359375     68127     299097  3.532     12.310056966042024
                    "Brunei Darussalam"        2000 103.171625469555  8.041    24272.986328125     80500     333926  3.331       9.15836044592086
                    "Brunei Darussalam"        2005 97.4576166216243  8.379     26895.33203125     83890     366717  3.438     1.8367549809509185
                    "Brunei Darussalam"        2010 95.3718566078117  8.631     27793.43359375     79901     396053  3.751     3.5070368794783624
                    "Brunei Darussalam"        2015 84.8970637867027  9.254     27655.99609375     76002     421437   4.29     1.3247017484599544
                    "Bulgaria"                 1995      55.59586718  8.806      84740.6796875   2562915    8406067   13.6     .47620831919051604
                    "Bulgaria"                 2000      78.29438767   8.96      76621.2109375   2881786    8170172   14.1      7.560896642822727
                    "Bulgaria"                 2005      100.4968811 10.626      101080.453125   2490022    7658972   14.8     13.720191370951929
                    "Bulgaria"                 2010      103.2072466  9.963     118529.1171875   2164258    7395599   14.9      3.636197821681888
                    "Bulgaria"                 2015      128.1117062  9.362     129420.3828125   1654879    7177991   15.3      4.374365215619172
                    "Burundi"                  1995 40.2046264145201  3.279   5408.06201171875     17255    5932783 18.823     .19810737848951104
                    "Burundi"                  2000 22.5537244890286  3.652   5086.01318359375     20000    6307659 15.907     1.3421519923982888
                    "Burundi"                  2005             35.1  3.712   5636.79345703125     27800    7388874 12.841      .0523404229187196
                    "Burundi"                  2010 39.5000053977394  4.446      7030.92578125     34972    9126605 10.538    .038411912050457374
                    "Burundi"                  2015 32.5419541361693   5.73    8317.7705078125     21774   10727148  8.553     1.5986729392923278
                    "Cambodia"                 1995 77.7667280459137  4.098   12823.4814453125      8528   10919528 11.064      4.382185008888245
                    "Cambodia"                 2000 110.885295448284  4.073     18108.28515625     30880   12118841  9.273     3.2377542259454635
                    "Cambodia"                 2005 136.831930064782  5.051    28300.595703125     32971   13246583  7.042      6.025383905492608
                    "Cambodia"                 2010 113.603718236027  5.984     39094.35546875    358850   14363532  6.121     12.491381184236868
                    "Cambodia"                 2015  127.86406699658  6.996     55303.88671875    256387   15417523   5.81     10.098663531382268
                    "Cameroon"                 1995      38.25012503  6.566     34106.29296875     65597   13211647  13.64     .13903398847810966
                    "Cameroon"                 2000      50.85286897  6.556      42272.5859375     95000   15091594 13.426     1.5114447818447732
                    "Cameroon"                 2005       50.9685648  6.244     52387.39453125    100331   17275171 12.408     1.2486084006088034
                    "Cameroon"                 2010      49.12385531  6.405        62191.03125    539504   19878036 10.992     1.9495240166158878
                    "Cameroon"                 2015        49.869207  7.797       79829.046875   1050281   23012646  9.179     2.1556402177657525
                    "Canada"                   1995      69.28235298 10.999         1059683.25  17567000   29302311    7.2      2.261072613335276
                    "Canada"                   2000      83.04164705 10.831        1290441.875  20840000   30685730    7.1      9.171024286715111
                    "Canada"                   2005      69.98287966 11.193            1465589  18148000   32243753    7.1      2.178163809175939
                    "Canada"                   2010      60.34993632 11.301        1551921.625  18394000   34004889      7     1.8372563874088144
                    "Canada"                   2015      66.31866724  11.44            1726018  15612271   35702908    7.4      3.853894537061533
                    "Central African Republic" 1995 50.4758911171183  4.138    4111.4638671875      8385    3276706 16.577      .5559102368678444
                    "Central African Republic" 2000 45.6597819937269  4.119   4553.72802734375      9468    3759170 17.325     .09697828652875673
                    "Central African Republic" 2005 35.0709368656226  4.059   4454.12158203125     10000    4208834 16.367      .7549176429227576
                    "Central African Republic" 2010 34.4304819543042  4.073   5357.99365234375       929    4660067 14.534      2.871289443866954
                    "Central African Republic" 2015 53.1451477769621  4.045  3895.487060546875      1881    4819333  12.15     .17690497231176788
                    "Chile"                    1995      54.96715328   9.71       184540.34375   1818000   14416796  5.352      4.026028906213383
                    "Chile"                    2000      59.31582211 10.158      226200.578125   3302498   15351799  4.959     6.2108918497459955
                    "Chile"                    2005      71.61676087 10.398           281748.5   3460645   16175311  5.301      6.100813120752643
                    "Chile"                    2010        69.063716 10.011       338959.53125   3459367   17004162  5.962      7.378757799061655
                    "Chile"                    2015       58.9722753 10.449       410327.46875   3445880   17870124  6.121     7.3264045661276365
                    "China"                    1995      34.27409603   8.32          4657186.5  40705700 1204855000   6.57      4.880444159849493
                    "China"                    2000      39.41053879  8.687            5962253 144829000 1262645000   6.45      3.475082245741743
                    "China"                    2005      62.20789287  8.861            9019761 350445000 1303720000   6.51      4.554254033929608
                    "China"                    2010      50.71707222  9.544           13947309 294383000 1337705000   7.11      4.003562900262925
                    "China"                    2015       39.6290069 11.258           18379366 230996000 1379860000   7.07     2.1921816030385988
                    end

                    Comment


                    • #11
                      Okay, now show us the code you used which illustrates your "no observations" problem.


                      Edit: Nick Cox says your dataset is too short for this question. I haven't read the help (and I'm not at my computer), but I would like to know why you get the error you get
                      Last edited by Jared Greathouse; 24 Apr 2023, 19:06.

                      Comment


                      • #12
                        Ok, this is the code:

                        xtunitroot llc Trade_to_GDP
                        no observations
                        r(2000);

                        It is the Levin Lin Chu tests that I have this problem.

                        Edit: this is the error (no observations):

                        Last edited by Andres Vinueza; 24 Apr 2023, 19:11.

                        Comment


                        • #13
                          Back in #3 and #5 I cross-referenced a Reddit thread, which gave a concise but informative explanation. Even before a data example was given here, the Reddit thread reported that the same error can be reproduced with the Grunfeld data and 5 time points (no problems there with lack of balance or missing values). If you put

                          Code:
                          set traced 2
                          set trace on
                          you'll see that the Levin-Lin-Chu calculation tries to fit a model and bails out because there are not enough data. At least that's my interpretation and in any case the manual entry warns repeatedly that you need a large number of time periods for the test to work well.

                          If you want or someone else is insisting on a test for stationarity for such very short panels, then you need a suitable expert to advise on what to do.

                          All that said, I don't think you need economic expertise to think that stationarity in trade over this time period is utterly implausible.
                          Last edited by Nick Cox; 25 Apr 2023, 01:31.

                          Comment

                          Working...
                          X