Announcement

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

  • no observations r(2000); error accures when running Pedroni and Westerlund cointegration tests.

    I have a panel data set of 4 countries and 5 vriables (GDP, Interest rate, inflation, exchange rate and trade openness).

    . xtset c_id year
    panel variable: c_id (strongly balanced)
    time variable: year, 2000 to 2019
    delta: 1 year

    The error accures when i include GDP to Pedroni and westerlund tests, when run them without it eveything works fine.

    . xtcointtest pedroni trade gdp ir exr inf, trend
    no observations
    r(2000);


    all variables are numeric and there is no missing values. im trying to understand what could be the problem?
    Last edited by ilyas sokol; 07 May 2021, 10:53. Reason: #error #cointegration #pedroni #westerland

  • #2
    What happens if you include gdp but exclude some other variable?

    Comment


    • #3
      same error no observations r(2000); accures, it only happens when gdp in included

      Comment


      • #4
        Code:
        * Example generated by -dataex-. To install: ssc install dataex
        clear
        input float c_id str18 countryname str3 countrycode int year double(trade ir exr inf gdp) float(dtrade dgdp dexr)
        1 "Brazil"             "BRA" 2000 22.63976136  48.50472819 1.829423122 7.044141059   655420645477          .           .           .
        1 "Brazil"             "BRA" 2001 26.93628502  45.63781871 2.349631709 6.840359025   559372276082  4.2965236 -9.6049e+10    .5202086
        1 "Brazil"             "BRA" 2002  27.6183574  48.34043744 2.920363018 8.450164377   507962487700   .6820724  -5.141e+10    .5707313
        1 "Brazil"             "BRA" 2003 28.14038472  46.44739884 3.077475118 14.71491972   558319920832   .5220273  5.0358e+10    .1571121
        1 "Brazil"             "BRA" 2004 29.67825248  43.77915272  2.92511945   6.5971851   669316654017  1.5378678 1.10997e+11  -.15235567
        1 "Brazil"             "BRA" 2005 27.08679521   44.6351679 2.434390036 6.869537209   891630177251 -2.5914574 2.22313e+11   -.4907294
        1 "Brazil"             "BRA" 2006 26.04169988  41.24032648 2.175326667 4.183568129  1107640289615 -1.0450953  2.1601e+11  -.25906336
        1 "Brazil"             "BRA" 2007 25.29261137  35.02251547 1.947058333 3.641272991  1397084349956  -.7490885  2.8944e+11  -.22826834
        1 "Brazil"             "BRA" 2008 27.25756942  35.36675779 1.833766667 5.678593903  1695824565983   1.964958  2.9874e+11  -.11329167
        1 "Brazil"             "BRA" 2009  22.1059756  34.79200964 1.999428173 4.888034799  1667019783585  -5.151594   -2.88e+10    .1656615
        1 "Brazil"             "BRA" 2010 22.77217811  29.11580553 1.759226711 5.038726901  2208871646203   .6662025  5.4185e+11  -.24020146
        1 "Brazil"             "BRA" 2011 23.93441065  32.83349283 1.672828755 6.636449622  2616200980392  1.1622325  4.0733e+11  -.08639795
        1 "Brazil"             "BRA" 2012 25.11429438  26.58202973 1.953068611  5.40349914  2465188674415  1.1798837 -1.5101e+11   .28023985
        1 "Brazil"             "BRA" 2013 25.78597608  18.49887161 2.156089151 6.204310666  2472806919902   .6716817    7.62e+09   .20302054
        1 "Brazil"             "BRA" 2014 24.68540582  22.40367244 2.352951963 6.329040155  2455993625159 -1.1005702  -1.682e+10    .1968628
        1 "Brazil"             "BRA" 2015 26.95364262  33.83234397 3.326904383 9.029901024  1802214373741  2.2682369 -6.5378e+11    .9739524
        1 "Brazil"             "BRA" 2016 24.53369803  40.69836145 3.491313422 8.739143523  1795700168991 -2.4199445   -6.51e+09   .16440904
        1 "Brazil"             "BRA" 2017 24.32771373  41.76030445 3.191389446  3.44637335  2062831045936  -.2059843  2.6713e+11    -.299924
        1 "Brazil"             "BRA" 2018 29.39778256  34.65918669 3.653825361 3.664850284  1885482534238   5.070069 -1.7735e+11    .4624359
        1 "Brazil"             "BRA" 2019 28.97662365   31.9917026 3.944471097 3.732976212  1839758040766  -.4211589  -4.572e+10   .29064575
        2 "Russian Federation" "RUS" 2000 68.09390704 -9.633111441 28.12916667 20.79876066   259710142197          .           .           .
        2 "Russian Federation" "RUS" 2001 61.11085866  1.226578507   29.168525 21.47700721   306602070621  -6.983048  4.6892e+10   1.0393584
        2 "Russian Federation" "RUS" 2002 59.64544573   .032935385 31.34848333 15.78873079   345470494418  -1.465413  3.8868e+10   2.1799583
        2 "Russian Federation" "RUS" 2003 59.12826901  -.600170683   30.692025 13.66329302   430347770732 -.51717675  8.4878e+10   -.6564583
        2 "Russian Federation" "RUS" 2004  56.5818524 -7.328985861 28.81374167 10.88861573   591016690743 -2.5464165 1.60669e+11  -1.8782834
        2 "Russian Federation" "RUS" 2005 56.71324849  -7.20668991 28.28444167 12.68530395   764017107992  .13139609    1.73e+11      -.5293
        2 "Russian Federation" "RUS" 2006 54.73340187 -4.078691839 27.19095833 9.668654548   989930542279 -1.9798466 2.25914e+11  -1.0934833
        2 "Russian Federation" "RUS" 2007 51.70612275 -3.344926611 25.58084537 9.007298689  1299705764824  -3.027279 3.09779e+11   -1.610113
        2 "Russian Federation" "RUS" 2008 53.38246604 -4.904962089   24.852875 14.11076778  1660846387625  1.6763433  3.6114e+11   -.7279704
        2 "Russian Federation" "RUS" 2009 48.43506103  13.07996529 31.74035833 11.64732958  1222644282202  -4.947405 -4.3821e+11    6.887483
        2 "Russian Federation" "RUS" 2010 50.35550549 -2.955083731 30.36791534 6.849392303  1524917468442  1.9204445  3.0228e+11   -1.372443
        2 "Russian Federation" "RUS" 2011 48.03539941 -12.85693529 29.38234137 8.440464859  2045925608274  -2.320106  5.2101e+11   -.9855739
        2 "Russian Federation" "RUS" 2012 47.15139039   .176416619 30.83983135 5.074743008  2208295773643   -.884009  1.6237e+11     1.45749
        2 "Russian Federation" "RUS" 2013  46.2871494  3.937070193 31.83714364 6.753710262  2292473246621   -.864241   8.417e+10    .9973123
        2 "Russian Federation" "RUS" 2014 47.80134126  3.397146835 38.37820714 7.823411839  2059241965491   1.514192 -2.3323e+11    6.541063
        2 "Russian Federation" "RUS" 2015 49.35934931  7.894593574 60.93765011 15.53440505  1363481063447   1.558008 -6.9576e+11    22.55944
        2 "Russian Federation" "RUS" 2016 46.51811984  9.484354473 67.05593333  7.04244763  1276786979222 -2.8412294  -8.669e+10    6.118283
        2 "Russian Federation" "RUS" 2017 46.87652434  4.945604231 58.34280119 3.683329444  1574199387071   .3584045  2.9741e+11   -8.713132
        2 "Russian Federation" "RUS" 2018 51.13314014 -2.013748878 62.66813333 2.878297236  1669583089323  4.2566156   9.538e+10    4.325332
        2 "Russian Federation" "RUS" 2019 49.07406987    4.7879691 64.73765833 4.470366608  1699876578871 -2.0590703    3.03e+10    2.069525
        3 "India"              "IND" 2000 26.90092291   8.34261083   44.941605 4.009439192   468394937262          .           .           .
        3 "India"              "IND" 2001 25.99325475  8.591449296 47.18641417 3.779290097   485441014539  -.9076682  1.7046e+10   2.2448092
        3 "India"              "IND" 2002 29.50866294   7.90717719 48.61031917 4.297158037   514937948870   3.515408  2.9497e+10    1.423905
        3 "India"              "IND" 2003 30.59243613   7.30788116 46.58328417  3.80586902   607699285434  1.0837731  9.2761e+10   -2.027035
        3 "India"              "IND" 2004 37.50381406  4.910128304 45.31646667 3.767236944   709148514805   6.911378  1.0145e+11  -1.2668175
        3 "India"              "IND" 2005 42.00166962  4.855145172   44.099975 4.246350828   820381595513  4.4978557 1.11233e+11  -1.2164917
        3 "India"              "IND" 2006  45.7244805  2.570606702 45.30700833  5.79651792   940259888792   3.722811 1.19878e+11   1.2070333
        3 "India"              "IND" 2007 45.68626868  5.681844063 41.34853333 6.372881356  1216735441525 -.03821182  2.7648e+11   -3.958475
        3 "India"              "IND" 2008 53.36822044   3.77175625 43.50518333 8.349267049  1198895582138   7.681952  -1.784e+10     2.15665
        3 "India"              "IND" 2009 46.27286964  4.808592108 48.40526667 10.88235294  1341886602799  -7.095351  1.4299e+11    4.900084
        3 "India"              "IND" 2010  49.2552065 -1.983859222 45.72581212 11.98938992  1675615335601   2.982337  3.3373e+11  -2.6794546
        3 "India"              "IND" 2011 55.62386544  1.317981799 46.67046667 8.858360966  1823050405350   6.368659  1.4743e+11    .9446545
        3 "India"              "IND" 2012 55.79372173  2.473519542 53.43723333 9.312445605  1827637859136   .1698563    4.59e+09    6.766767
        3 "India"              "IND" 2013 53.84413195  3.865992863 58.59784542 10.90764331  1856722121395 -1.9495897   2.908e+10    5.160612
        3 "India"              "IND" 2014 48.92218575   6.69517609 61.02951446 6.353194544  2039127446299  -4.921946  1.8241e+11    2.431669
        3 "India"              "IND" 2015  41.9229138  7.556487908 64.15194446 5.872426595  2103587817042  -6.999272   6.446e+10     3.12243
        3 "India"              "IND" 2016 40.08248575  6.232712017 67.19531281 4.941026458  2294797978292  -1.840428  1.9121e+11    3.043368
        3 "India"              "IND" 2017 40.72281128  5.521621876 65.12156865 2.490886999  2652754685835   .6403255  3.5795e+11   -2.073744
        3 "India"              "IND" 2018  43.4049695  4.685186552 68.38946709 4.860699467  2713165057513   2.682158   6.042e+10    3.267898
        3 "India"              "IND" 2019 39.55006082  6.369116589 70.42034054 7.659694743  2868929415617  -3.854909  1.5576e+11   2.0308735
        4 "China"              "CHN" 2000 39.41053879  3.710664081 8.278504167  .347806257  1211346869605          .           .           .
        4 "China"              "CHN" 2001 38.52735928   3.72666389 8.277068333  .719132437  1339395718865  -.8831795  1.2805e+11 -.001435834
        4 "China"              "CHN" 2002 42.74740363  4.679724345   8.2769575   -.7319755  1470550015082   4.220044  1.3115e+11 -.000110833
        4 "China"              "CHN" 2003   51.803988  2.638146636 8.277036667 1.127601961  1660287965663   9.056584  1.8974e+11  .000079167
        4 "China"              "CHN" 2004 59.50552422 -1.282811705 8.276800833 3.824637624  1955347004963   7.701536  2.9506e+11 -.000235834
        4 "China"              "CHN" 2005 62.20789287  1.613277503 8.194316667 1.776416168  2285965892361   2.702369  3.3062e+11  -.08248416
        4 "China"              "CHN" 2006  64.4788839  2.110577726 7.973438333 1.649433101  2752131773355   2.270991  4.6616e+11  -.22087833
        4 "China"              "CHN" 2007 62.19336348  -.259570586   7.6075325 4.816765313  3550342737011 -2.2855203  7.9821e+11   -.3659058
        4 "China"              "CHN" 2008 57.61271534 -2.305615343    6.948655 5.925255289  4594307032661  -4.580648 1.04397e+12   -.6588775
        4 "China"              "CHN" 2009 45.18487038  5.531122909 6.831416052 -.728171334  5101703073086 -12.427845  5.0739e+11  -.11723895
        4 "China"              "CHN" 2010 50.71707766 -1.002401214 6.770269029 3.175327981  6087163874512   5.532207  9.8546e+11  -.06114702
        4 "China"              "CHN" 2011 50.74090459 -1.402428747 6.461461327 5.553897059  7551500124203  .02382693 1.46434e+12   -.3088077
        4 "China"              "CHN" 2012 48.26752237  3.585203529 6.312332827 2.619526165  8532229986994  -2.473382  9.8073e+11   -.1491285
        4 "China"              "CHN" 2013 46.74437558  3.755387055 6.195758346 2.621049027  9570406235660 -1.5231467 1.03818e+12  -.11657448
        4 "China"              "CHN" 2014 44.90521595  4.522308432       6.162 1.921643416 10475682920595 -1.8391596  9.0529e+11 -.033758346
        4 "China"              "CHN" 2015 39.46416934  4.353072252      6.2827 1.437024514 11061553079876  -5.441047   5.859e+11       .1207
        4 "China"              "CHN" 2016 36.89441502  2.901815389        6.64           2 11233276536737 -2.5697544   1.717e+11       .3573
        4 "China"              "CHN" 2017 37.63241324   .112553973      6.7569 1.593137255 12310409370893   .7379982  1.0771e+12       .1169
        4 "China"              "CHN" 2018 37.45624357   .821501872       6.609 2.074788902 13894817549374 -.17616966  1.5844e+12      -.1479
        4 "China"              "CHN" 2019 35.83741382  3.023620261      6.9081 2.899235799 14279937467431 -1.6188297   3.851e+11       .2991
        end
        format %ty year
        The dataset

        Comment


        • #5
          Your GDP variable is extraordinary with values like

          14279937467431

          so someone is implying that measurement is trustworthy up to 14 significant figures, which is unattainable outside highly specialised branches of physics.

          With GDP even the second significant figure is often dubious given uncertainty about certain sectors (e.g. black markets, crime, housework, Stata programming) and whether and how their contributions are measured. .

          My guess is that somewhere inside the command there is a conversion or copying to
          float that fails. If you work with a copy with larger units, e.g.
          Code:
          gen float GDP = gdp/1e6
          and try again you may get better results.
          Last edited by Nick Cox; 08 May 2021, 04:48.

          Comment


          • #6
            Everything works now, thank you for the help!

            Comment

            Working...
            X