Announcement

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

  • The problem of repeated time values in sample r(451)

    Hello everyone,
    I am having a panel data for 46 cross sections, four years (daily), and six variables.
    It looks like;

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str5 Stations float id int Date double(PM10_AVG PM25_AVG SO2_AVG NO2_AVG O3_AVG  CO_AVG)
    "CA01R"   1 21185 22.154  8.967 .0005 .0019 .0305 .356
    "CA01R"   2 21186 25.912 11.405 .0005 .0021 .0349 .394
    "CA01R"   3 21187 22.494  8.776 .0005 .0035 .0235 .431
    "CA01R"   4 21188 22.417  9.058 .0005 .0042 .0214 .438
    "CA01R"   5 21189 20.607 11.961 .0005  .004 .0205 .513
    "CA01R"   6 21190 27.446 17.772 .0005  .005  .018 .629
    "CA01R"   7 21191 19.367 11.426 .0005 .0038 .0209 .513
    "CA01R"   8 21192 18.457  8.553 .0005 .0049 .0149 .488
    "CA01R"   9 21193 16.537  8.827 .0004 .0037 .0157 .479
    "CA01R"  10 21194 16.255  8.351 .0004 .0045 .0106   .5
    "CA01R"  11 21195  15.77  8.473 .0004 .0057  .016 .611
    "CA01R"  12 21196 16.666  8.658 .0004 .0048 .0215 .617
    "CA01R"  13 21197 26.045 14.869 .0005 .0055 .0273 .669
    "CA01R"  14 21198 24.982 15.246 .0005 .0046 .0289 .585
    "CA01R"  15 21199 29.949 18.267 .0005 .0054 .0289 .571
    "CA01R"  16 21200 24.381 13.882 .0005 .0067 .0256 .533
    "CA01R"  17 21201 22.963 13.261 .0005 .0028  .026 .507
    "CA01R"  18 21202 31.064 18.878 .0006 .0037 .0318 .569
    "CA01R"  19 21203 25.635 15.188 .0006 .0043  .023 .552
    "CA01R"  20 21204 19.684 11.138 .0006 .0042 .0193  .53
    "CA01R"  21 21205 15.864  7.785 .0006 .0029 .0154 .493
    "CA01R"  22 21206 20.609  8.964 .0006  .004  .013 .532
    "CA01R"  23 21207 19.394 10.138 .0006 .0041 .0131 .487
    "CA01R"  24 21208 14.556  6.381 .0005  .004 .0114 .402
    "CA01R"  25 21209 20.631 10.443 .0005 .0036 .0124 .394
    "CA01R"  26 21210 19.684 10.163 .0005 .0034 .0139 .352
    "CA01R"  27 21211 19.349 10.231 .0005 .0035  .013 .386
    "CA01R"  28 21212 19.831 10.255 .0005 .0037 .0142 .392
    "CA01R"  29 21213 20.561 11.316 .0005 .0047 .0144  .52
    "CA01R"  30 21214 22.827 13.204 .0006 .0036 .0198 .483
    "CA01R"  31 21215 20.732 11.915 .0005  .003 .0176 .397
    "CA01R"  32 21216  17.28  9.663 .0006 .0024 .0226  .42
    "CA01R"  33 21217 20.749  9.984 .0006 .0032 .0252 .497
    "CA01R"  34 21218 22.607 10.336 .0006 .0045 .0278 .488
    "CA01R"  35 21219  28.41 15.092 .0007  .004 .0408 .518
    "CA01R"  36 21220  28.14 16.344 .0006 .0035 .0448 .539
    "CA01R"  37 21221 31.143 17.224 .0007 .0045 .0443  .49
    "CA01R"  38 21222 29.447 17.083 .0007 .0033 .0457 .478
    "CA01R"  39 21223 29.188 17.601 .0007  .003 .0468 .479
    "CA01R"  40 21224 41.456 30.208 .0008 .0033 .0557 .573
    "CA01R"  41 21225 39.568 29.171 .0009 .0042 .0493 .524
    "CA01R"  42 21226 36.774  27.17 .0008 .0038 .0462 .531
    "CA01R"  43 21227 37.026 27.471 .0008 .0056 .0418 .573
    "CA01R"  44 21228 21.612 14.266 .0007 .0043 .0312 .519
    "CA01R"  45 21229 22.191 15.257 .0006  .003 .0292 .489
    "CA01R"  46 21230 20.712 15.427 .0006 .0032 .0284 .533
    "CA01R"  47 21231 32.403 24.703 .0006  .003 .0299 .639
    "CA01R"  48 21232 40.762  32.22 .0006  .003  .035 .713
    "CA01R"  49 21233 35.243 28.038 .0006 .0021 .0379 .642
    "CA01R"  50 21234 19.271   14.5 .0006 .0021 .0233 .515
    "CA01R"  51 21235 15.754 10.336 .0006  .002 .0188 .462
    "CA01R"  52 21236 17.513  11.28 .0006 .0016 .0183 .438
    "CA01R"  53 21237 18.282 11.194 .0006 .0019 .0183 .449
    "CA01R"  54 21238 14.401  9.154 .0006 .0019 .0154 .462
    "CA01R"  55 21239 14.506  8.613 .0006  .002 .0162 .459
    "CA01R"  56 21240 19.818 11.582 .0006 .0023 .0175 .434
    "CA01R"  57 21241 21.251 12.988 .0007 .0026 .0204 .464
    "CA01R"  58 21242 18.962 11.569 .0007 .0026 .0175 .427
    "CA01R"  59 21243 20.801 14.006 .0007 .0028 .0234 .397
    "CA01R"  60 21244 17.015 10.508 .0007 .0029 .0221 .417
    "CA01R"  61 21245 16.571 10.992 .0007 .0029 .0203  .42
    "CA01R"  62 21246 14.402  8.208 .0007 .0029  .019  .41
    "CA01R"  63 21247 16.617 10.829 .0007 .0033 .0167 .458
    "CA01R"  64 21248 15.202  9.084 .0007 .0028 .0165   .4
    "CA01R"  65 21249 16.774  10.29 .0007 .0031 .0216  .43
    "CA01R"  66 21250 18.876  9.772 .0007 .0035 .0137 .442
    "CA01R"  67 21251 37.863 11.897 .0007 .0041 .0196 .418
    "CA01R"  68 21252 26.247 10.374 .0007 .0036 .0172 .406
    "CA01R"  69 21253 26.379 11.516 .0007 .0029 .0245  .46
    "CA01R"  70 21254 27.884 12.719 .0007 .0036 .0293  .51
    "CA01R"  71 21255 30.836 13.736 .0007 .0041 .0268 .485
    "CA01R"  72 21256 25.705 12.795 .0008  .003 .0261 .421
    "CA01R"  73 21257 30.157 17.679 .0008 .0029 .0349 .479
    "CA01R"  74 21258 26.348 14.957 .0007 .0046 .0222 .509
    "CA01R"  75 21259  25.03 14.393 .0007 .0054 .0228 .556
    "CA01R"  76 21260 18.812 10.733 .0007 .0049 .0187 .504
    "CA01R"  77 21261 14.822  8.846 .0007 .0025 .0191 .412
    "CA01R"  78 21262 17.482  10.32 .0007 .0034 .0209 .421
    "CA01R"  79 21263 20.215 12.262 .0007 .0037 .0206 .442
    "CA01R"  80 21264 19.947 13.815 .0007 .0035 .0198 .473
    "CA01R"  81 21265 19.686 10.856 .0008 .0036 .0189 .426
    "CA01R"  82 21266 17.558  9.689 .0009 .0031 .0264 .455
    "CA01R"  83 21267 22.302 11.285 .0007 .0037 .0288 .514
    "CA01R"  84 21268 31.374 13.623 .0008 .0028 .0305 .503
    "CA01R"  85 21269 29.478  14.32 .0009 .0038 .0245 .467
    "CA01R"  86 21270 34.207 15.504 .0008 .0077 .0256 .471
    "CA01R"  87 21271 30.258 17.602 .0008 .0039 .0372 .487
    "CA01R"  88 21272 33.031 18.665 .0008 .0049 .0316 .521
    "CA01R"  89 21273 39.489 23.787 .0008 .0061 .0287 .605
    "CA01R"  90 21274 35.216 20.035 .0008 .0066 .0293 .563
    "CA01R"  91 21275 28.689 18.283 .0008 .0071 .0297 .591
    "CA01R"  92 21276 36.818 22.169 .0007 .0062 .0289  .63
    "CA01R"  93 21277 32.248 17.597 .0006 .0039 .0312 .553
    "CA01R"  94 21278  35.04 20.648 .0006 .0044 .0341 .586
    "CA01R"  95 21279 36.995 22.629 .0007 .0041 .0362 .564
    "CA01R"  96 21280 32.323 19.675 .0008 .0038 .0374 .525
    "CA01R"  97 21281 30.103 18.277 .0007  .005 .0269 .505
    "CA01R"  98 21282 24.405 13.006 .0007 .0037 .0254 .474
    "CA01R"  99 21283 25.991 11.895 .0006 .0037 .0257 .455
    "CA01R" 100 21284 20.831  9.699 .0005 .0035 .0253 .459
    end
    format %tdnn/dd/CCYY Date
    i keep on receiving this message when i am trying to find the optimal lag using varsoc command " repeated time values in sample r(451)". I checked repeated dates using Paivot table and it looks fine all dates are counts the same.

    Any suggestions please?
    Thank you in advanced

    Amaa

  • #2
    varsoc is a time-series command, so you cannot use it with panel data unless you intend to analyze each panel separately. See

    Code:
    help varsoc

    Comment


    • #3
      Andrew Musau thanx for your reply. So how to find the optimal lag in this case?

      Comment


      • #4
        You state that you have panel data. Some of the issues that arise with time-series data do not arise with panel data and vice-versa. So the analysis of time-series data differs from that of panel data. What is your research question? What do you want to achieve? By the way, looking at #1, it does not appear that you have panel data as no date is repeated. For your full sample, can you show the result of

        Code:
        isid Date
        Last edited by Andrew Musau; 15 Aug 2023, 01:31.

        Comment


        • #5
          My goal is to apply ARDL model to my variables. I want to examine the speed of adjustments between stations.
          This is just a part of my data, i have 46 cross sections for 4 years (daily averages) for 6 variables.
          . isid Date
          variable Date does not uniquely identify the observations
          r(459);

          this is the result

          Comment


          • #6
            ARDL is for time-series data and cannot be used here as I indicated earlier. If you have panel data, you may want to look into panel ARDL if you have grounds to believe that it is the right estimation approach. The initial steps in this approach involve checking for unit roots (using the so-called 2nd generation tests) to ensure no I(2) variables are present and then check for cointegration before proceeding to estimate the panel ARDL model. Look at some empirical applications or consult someone with experience with such models (e.g., supervisor or colleague) to determine whether you should go that route.
            Last edited by Andrew Musau; 15 Aug 2023, 01:57.

            Comment


            • #7
              Dear Prof, I have one question related to estat sbcusum in ARDL in ECM form. after running ARDL in ECM form and then run estat sbcusum,

              why dose it get error in function as below?

              . estat sbcusum
              sbs_est_cusum(): 3301 subscript invalid
              <istmt>: - function returned error

              Thank In advance

              Comment


              • #8
                Kong:
                you should have better opened a new thread.
                For the future, please act on the aforementioned advice . Thanks.
                That said, the first thing I would check is the last update of my Stata copy.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  My one more question
                  Dose Stata have code for test CUSUMQ for structure break ? Thank

                  Comment


                  • #10
                    Kong:
                    type -search structural break-.
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment

                    Working...
                    X