Announcement

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

  • Error stating missing value in the sample

    I am trying to analyze my pannel data during which the error occurred, I tried xtsum which I have attached, kindly help me with this.

    Thank you in advance.


    Variable | Mean Std. dev. Min Max | Observations
    -----------------+--------------------------------------------+----------------
    Economy overall | . . . . | N = 0
    between | . . . | n = 0
    within | . . . | T = .
    | |
    Econom~r overall | 1.5 .5163978 1 2 | N = 16
    between | .7071068 1 2 | n = 2
    within | 0 1.5 1.5 | T = 8
    | |
    Year overall | 2017.5 2.366432 2014 2021 | N = 16
    between | 0 2017.5 2017.5 | n = 2
    within | 2.366432 2014 2021 | T = 8
    | |
    Numbe~ch overall | 11.48781 2.820698 8.452603 14.74769 | N = 16
    between | 3.807684 8.795369 14.18025 | n = 2
    within | .4731056 10.13299 12.05525 | T = 8
    | |
    Number~t overall | 14.7279 6.425385 5.771227 21.99705 | N = 16
    between | 8.529992 8.696283 20.75951 | n = 2
    within | 1.574751 11.69453 17.48109 | T = 8
    | |
    Num~1000 overall | 439.895 336.6709 71.90912 903.3731 | N = 16
    between | 432.2264 134.2648 745.5252 | n = 2
    within | 117.0903 122.6967 597.7429 | T = 8
    | |
    Numbe~th overall | 1321.245 540.0604 645.5244 2046.75 | N = 16
    between | 687.026 835.4445 1807.046 | n = 2
    within | 199.8234 846.3593 1560.949 | T = 8
    | |
    GDPPER~A overall | 1850.483 362.6358 1108.515 2457.925 | N = 16
    between | 36.60141 1824.602 1876.364 | n = 2
    within | 361.6493 1134.396 2483.806 | T = 8
    | |
    Inflat~l overall | 6.03292 6.100776 2.279588 27.85074 | N = 16
    between | 2.404597 4.332613 7.733227 | n = 2
    within | 5.842575 1.957841 26.15043 | T = 8

  • #2
    Anant:
    welcome to this forum.
    Are you sure that your -Economy_overall_ viariable is not in -string- format?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo

      yes i destrined it, moreover i used tsfill then the whole data emerged in daily data from yearly data. what should I do thank you

      Economy Economynumber Year Numberofcommercialbankbranch NumberofATMsper100000adult Numberofdebitcardsper1000 Numberofdepositaccountswith GDPPERCAPITA InflationGDPdeflatorannual
      India 1 1/1/2014 12.82543 17.72615 428.32692 1332.16 1559.8645 3.3317569
      1 1/2/2014
      1 1/3/2014
      1 1/4/2014
      1 1/5/2014
      1 1/6/2014
      1 1/7/2014
      1 1/8/2014
      1 1/9/2014
      1 1/10/2014
      1 1/11/2014
      1 1/12/2014
      1 1/13/2014
      1 1/14/2014
      1 1/15/2014
      1 1/16/2014
      1 1/17/2014
      1 1/18/2014
      1 1/19/2014
      1 1/20/2014
      1 1/21/2014
      1 1/22/2014
      1 1/23/2014
      1 1/24/2014
      1 1/25/2014
      1 1/26/2014
      1 1/27/2014
      1 1/28/2014
      1 1/29/2014
      1 1/30/2014
      1 1/31/2014
      1 2/1/2014
      1 2/2/2014
      1 2/3/2014
      1 2/4/2014
      1 2/5/2014
      1 2/6/2014
      1 2/7/2014
      1 2/8/2014
      1 2/9/2014

      Comment


      • #4
        +---------------------------------------------------------------------------------------------------+
        | Economy Econom~r Year Numbe~ch Number~t Numb~1000 Numbe~th GDPPERC~A Inflati~l |
        |---------------------------------------------------------------------------------------------------|
        1. | India 1 2004 8.932034 . . 605.3714 624.10509 5.7254132 |
        2. | India 1 2005 8.89375 2.285558 . 604.7394 710.50935 5.6219033 |
        3. | India 1 2006 8.831113 2.730802 95.133374 615.484 802.01374 8.4009382 |
        4. | India 1 2007 8.946737 3.367224 127.33994 645.4002 1022.7316 6.9444183 |
        5. | India 1 2008 9.255914 4.273244 167.43321 708.6434 993.50377 9.1939696 |
        |---------------------------------------------------------------------------------------------------|
        6. | India 1 2009 9.546478 5.292054 217.33132 791.0043 1096.635 7.0403654 |
        7. | India 1 2010 9.988923 7.240433 266.79284 860.5066 1350.6343 10.526031 |
        8. | India 1 2011 10.45775 8.818322 319.77206 930.9211 1449.6018 8.7335801 |
        9. | India 1 2012 11.13031 10.95003 373.41186 1018.324 1434.0182 7.9343863 |
        10. | India 1 2013 11.80157 12.81626 366.39969 1156.189 1438.0575 6.186504 |
        |---------------------------------------------------------------------------------------------------|
        11. | India 1 2014 12.82543 17.72615 428.32692 1332.16 1559.8645 3.3317569 |
        12. | India 1 2015 13.52214 19.64088 590.32986 1535.837 1590.1739 2.2795881 |
        13. | India 1 2016 14.2081 21.16815 693.03635 1724.499 1714.2804 3.237975 |
        14. | India 1 2017 14.4889 21.99705 794.83793 1881.544 1957.9688 3.9692579 |
        15. | India 1 2018 14.46396 21.65312 872.67591 1937.254 1974.3778 3.8842403 |
        |---------------------------------------------------------------------------------------------------|
        16. | India 1 2019 14.60455 20.953 903.3731 1967.613 2047.2327 2.3907488 |
        17. | India 1 2020 14.74769 21.49655 813.12303 2030.711 1910.4215 5.6009192 |
        18. | India 1 2021 14.58121 21.4412 868.49866 2046.75 2256.5904 9.9664167 |
        19. | Bangladesh 2 2004 7.124846 .1289717 . 351.3939 469.11646 4.5621364 |
        20. | Bangladesh 2 2005 7.070177 .2016294 . 361.5841 492.80865 4.5863607 |
        |---------------------------------------------------------------------------------------------------|
        21. | Bangladesh 2 2006 7.100427 .3543234 . 372.3945 503.53833 5.8759358 |
        22. | Bangladesh 2 2007 7.134832 .5118123 . 382.6709 552.33893 6.4712601 |
        23. | Bangladesh 2 2008 7.183729 .8434421 . 399.3834 630.10898 7.8609661 |
        24. | Bangladesh 2 2009 7.399998 1.285765 . 405.7874 698.52103 6.7643547 |
        25. | Bangladesh 2 2010 7.659616 2.113169 . 486.0414 776.85958 7.144663 |
        |---------------------------------------------------------------------------------------------------|
        26. | Bangladesh 2 2011 7.869342 3.709023 . 542.9051 856.38159 7.8594509 |
        27. | Bangladesh 2 2012 8.075109 4.03995 . 576.6896 876.81755 8.1645737 |
        28. | Bangladesh 2 2013 8.251269 4.95546 . 617.1205 973.77339 7.1749534 |
        29. | Bangladesh 2 2014 8.452603 5.771227 71.909121 645.5244 1108.5151 5.6687885 |
        30. | Bangladesh 2 2015 8.609373 7.093638 78.026465 699.3682 1236.0051 5.872777 |
        |---------------------------------------------------------------------------------------------------|
        31. | Bangladesh 2 2016 8.710495 8.028155 113.62131 744.5934 1659.9616 27.850738 |
        32. | Bangladesh 2 2017 8.82259 8.358427 130.09839 788.8304 1815.6094 5.0475976 |
        33. | Bangladesh 2 2018 8.94265 8.919507 143.28677 854.4649 1963.4119 5.8055388 |
        34. | Bangladesh 2 2019 8.954769 9.419066 153.62306 925.1551 2122.0789 3.6581481 |
        35. | Bangladesh 2 2020 8.895153 10.53077 177.2174 991.0607 2233.3055 3.8410522 |
        |---------------------------------------------------------------------------------------------------|
        36. | Bangladesh 2 2021 8.975322 11.44947 206.33579 1034.559 2457.9249 4.1211754 |
        37. | . . . . . . . . |
        38. | . . . . . . . . |
        +---------------------------------------------------------------------------------------------------+

        .
        this is my data I want to perform unit root test and VAR model for this data, however the data is unbalanced kindly help me with this

        thank you

        Comment


        • #5
          Anant:
          with N=16 and T=8 you are dealing with a short panel.
          See -xtreg-, if your dependent variable is continuous.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Hi, I chnaged my model and was trying to do fixed and random effect model for a single country data but it shows error as no observation. My code and error is-. xtreg log_dgp log_Numberofdepositaccountswith log_Numberofdebitcardsper1000 log_Numberofcommercialbankbranch log_
            > NumberofATMsper100000adult log_inflation, fe
            no observations
            r(2000);

            And my data is -

            Economy Economynumber Year year_en Numberofcommercialbankbranch NumberofATMsper100000adult Numberofdebitcardsper1000 Numberofdepositaccountswith GDPPERCAPITA InflationGDPdeflatorannual log_dgp log_inflation log_NumberofATMsper100000adult log_Numberofcommercialbankbranch log_Numberofdebitcardsper1000 log_Numberofdepositaccountswith
            India 1 2004 200401 8.932034 605.3714 624.10509 5.7254132 6.436319 1.744915 2.189644 6.405842
            India 1 2005 200501 8.89375 2.285558 604.7394 710.50935 5.6219033 6.565982 1.72667 .8266102 2.185349 6.404798
            India 1 2006 200601 8.831113 2.730802 95.133374 615.484 802.01374 8.4009382 6.687126 2.128343 1.004595 2.178281 4.55528 6.422409
            India 1 2007 200701 8.946737 3.367224 127.33994 645.4002 1022.7316 6.9444183 6.930233 1.937938 1.214089 2.191289 4.84686 6.469871
            India 1 2008 200801 9.255914 4.273244 167.43321 708.6434 993.50377 9.1939696 6.901238 2.218548 1.452373 2.225263 5.120584 6.563353
            India 1 2009 200901 9.546478 5.292054 217.33132 791.0043 1096.635 7.0403654 7.000001 1.95166 1.666206 2.256172 5.381423 6.673304
            India 1 2010 201001 9.988923 7.240433 266.79284 860.5066 1350.6343 10.526031 7.20833 2.353851 1.979681 2.301477 5.586473 6.757521
            India 1 2011 201101 10.45775 8.818322 319.77206 930.9211 1449.6018 8.7335801 7.279044 2.167175 2.176831 2.347343 5.767609 6.836174
            India 1 2012 201201 11.13031 10.95003 373.41186 1018.324 1434.0182 7.9343863 7.268236 2.071206 2.393342 2.409672 5.922682 6.925913
            India 1 2013 201301 11.80157 12.81626 366.39969 1156.189 1438.0575 6.186504 7.271049 1.82237 2.550715 2.468233 5.903725 7.052885
            India 1 2014 201401 12.82543 17.72615 428.32692 1332.16 1559.8645 3.3317569 7.352354 1.2035 2.875041 2.55143 6.059887 7.194557
            India 1 2015 201501 13.52214 19.64088 590.32986 1535.837 1590.1739 2.2795881 7.371599 .8239948 2.977613 2.604328 6.380682 7.336831
            India 1 2016 201601 14.2081 21.16815 693.03635 1724.499 1714.2804 3.237975 7.446749 1.174948 3.052498 2.653812 6.541082 7.452692
            India 1 2017 201701 14.4889 21.99705 794.83793 1881.544 1957.9688 3.9692579 7.579663 1.378579 3.090908 2.673383 6.678138 7.539848
            India 1 2018 201801 14.46396 21.65312 872.67591 1937.254 1974.3778 3.8842403 7.588008 1.356927 3.07515 2.67166 6.771564 7.569027
            India 1 2019 201901 14.60455 20.953 903.3731 1967.613 2047.2327 2.3907488 7.624244 .8716066 3.042282 2.681333 6.806136 7.584577
            India 1 2020 202001 14.74769 21.49655 813.12303 2030.711 1910.4215 5.6009192 7.555079 1.722931 3.067893 2.691087 6.700882 7.616141
            India 1 2021 202101 14.58121 21.4412 868.49866 2046.75 2256.5904 9.9664167 7.72161 2.299221 3.065314 2.679734 6.766766 7.624009


            Thank you in Advance.

            Comment


            • #7
              Anant:
              you cannot run a panel data regression on one single country, as your -panelid- =1.
              You should go -regress-.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Thanks a lot for that Carlo, I want to ask that do we need to do unit root tests for random and different effect mode and if heteroskedasticity is present in my model I used fe robust will that is fine?

                Comment


                • #9
                  Anant:
                  usually unit root tests are not necessary with short panel dataset.
                  Last edited by Carlo Lazzaro; 06 Jul 2023, 00:52.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Hi Carlo, I am also doing gmm model test for the panel data with 5 countries, my stata code is correct or not - xtabond2 log_gdp l.log_gdp log_NumberofATMsper100000adult log_Numberofcommercialbankbranch log_Numberofdebitcardsper1000 log_Numberofdeposit
                    > accountswith log_TotalTrade log_inflation log_ExpenseofGDP, gmm(l.log_gdp, nocollapse) iv(log_NumberofATMsper100000adult log_Numberofcommerc
                    > ialbankbranch, equation(level)) nodiffsargan twostep orthogonal

                    dependent variable= log gdp
                    independent variable- og_NumberofATMsper100000adult log_Numberofcommercialbankbranch log_Numberofdebitcardsper1000 log_Numberofdepositaccountswith
                    control variable= log_TotalTrade log_inflation log_ExpenseofGDP

                    my result is-
                    Warning: Number of instruments may be large relative to number of observations.
                    Warning: Two-step estimated covariance matrix of moments is singular.
                    Using a generalized inverse to calculate optimal weighting matrix for two-step estimation.

                    Dynamic panel-data estimation, two-step system GMM
                    ------------------------------------------------------------------------------
                    Group variable: Economynum~r Number of obs = 21
                    Time variable : Year Number of groups = 2
                    Number of instruments = 22 Obs per group: min = 8
                    Wald chi2(8) = 23.44 avg = 10.50
                    Prob > chi2 = 0.003 max = 13
                    --------------------------------------------------------------------------------------------------
                    log_gdp | Coefficient Std. err. z P>|z| [95% conf. interval]
                    ---------------------------------+----------------------------------------------------------------
                    log_gdp |
                    L1. | 0 (omitted)
                    |
                    log_NumberofATMsper100000adult | .3013952 .0626397 4.81 0.000 .1786237 .4241667
                    log_Numberofcommercialbankbranch | 0 (omitted)
                    log_Numberofdebitcardsper1000 | 0 (omitted)
                    log_Numberofdepositaccountswith | 0 (omitted)
                    log_TotalTrade | -.3359857 .3903807 -0.86 0.389 -1.101118 .4291464
                    log_inflation | 0 (omitted)
                    log_ExpenseofGDP | 0 (omitted)
                    _cons | 0 (omitted)
                    --------------------------------------------------------------------------------------------------
                    Warning: Uncorrected two-step standard errors are unreliable.

                    Instruments for orthogonal deviations equation
                    GMM-type (missing=0, separate instruments for each period unless collapsed)
                    L(1/17).L.log_gdp
                    Instruments for levels equation
                    Standard
                    log_NumberofATMsper100000adult log_Numberofcommercialbankbranch
                    _cons
                    GMM-type (missing=0, separate instruments for each period unless collapsed)
                    D.L.log_gdp
                    ------------------------------------------------------------------------------
                    Arellano-Bond test for AR(1) in first differences: z = 0.96 Pr > z = 0.339
                    Arellano-Bond test for AR(2) in first differences: z = -0.15 Pr > z = 0.881
                    ------------------------------------------------------------------------------
                    Sargan test of overid. restrictions: chi2(13) = 19.02 Prob > chi2 = 0.122
                    (Not robust, but not weakened by many instruments.)
                    Hansen test of overid. restrictions: chi2(13) = 0.00 Prob > chi2 = 1.000
                    (Robust, but weakened by many instruments.)

                    Thank you in advance

                    Comment


                    • #11
                      Anant:
                      do you really have 21 observations and 22 instruments?
                      If this is true, there's no regression command that can work with such a limited dataset.
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment

                      Working...
                      X