Announcement

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

  • No observations on regression

    I am attempting to regress FTSE returns on my search index UKIS and use EPU (economic policy uncertainty index) and 5 lags of rmrf (UK excess market return). When I do this I get an r(2000) error stating there are no observations.

    The code I am using is:
    Code:
    tsset date
    reg lretFTSE100 UKIS EPU rmrf L1.rmrf L2.rmrf L3.rmrf L4.rmrf L5.rmrf
    no observations
    r(2000);
    Data:

    Code:
    input int date float(lretFTSE100 UKIS) double(EPU rmrf) 16253   -.008853907           .  75.14 -.00833516 16254   -.003922053   -.2180105  30.11 -.00400119 16255             .    .3280379  46.34          . 16256             .   -.1164731  41.63          . 16257             .   -.5526805 276.08 -.00167145 16258   -.007417386   .25532183 167.46 -.00767937 16259   -.002834197     .381967 257.54 -.00251354 16260    .005203983   -.3521871  27.22  .00334938 16261   .0027512214    .1600098      0  .00217685 16262             .  .016313126 103.71          . 16263             .  -.11036982 250.09          . 16264             . -.024156913 204.16 -.00654372 16265 -.00051160227    .1126608 296.38  -.0001302 16266   .0033927886   -.1054983 113.19  .00177553 16267   -.007308434   .16306344  54.77 -.00682801 16268  -.0003410162  .067925915  60.37  .00029166 16269             .   .06046037  81.68          . 16270             .  -.19248436 118.62          . 16271             .   .08850786  40.17 -.00396609 16272   .0042191767  .014100888 113.13  .00276665 16273     .00870292    .2632147 324.83  .00808184 16274    -.01636464    -.344536  187.1 -.01562203 16275   .0046544634    .2210378      0  .00353599 16276             .   .05127193 221.74          . 16277             .  -.26678687 120.89          . 16278             .    .2210185 109.95 -.00932341 16279    .008783252   -.0252831   91.8  .00760169
    Not really sure if this is a data problem or econometric problem?

  • #2
    Not really sure what has happened to that data inputted

    Code:
    input int date float(lretFTSE100 UKIS) double(EPU rmrf)
    16253   -.008853907           .  75.14 -.00833516
    16254   -.003922053   -.2180105  30.11 -.00400119
    16255             .    .3280379  46.34          .
    16256             .   -.1164731  41.63          .
    16257             .   -.5526805 276.08 -.00167145
    16258   -.007417386   .25532183 167.46 -.00767937
    16259   -.002834197     .381967 257.54 -.00251354
    16260    .005203983   -.3521871  27.22  .00334938
    16261   .0027512214    .1600098      0  .00217685
    16262             .  .016313126 103.71          .
    16263             .  -.11036982 250.09          .
    16264             . -.024156913 204.16 -.00654372
    16265 -.00051160227    .1126608 296.38  -.0001302
    16266   .0033927886   -.1054983 113.19  .00177553
    16267   -.007308434   .16306344  54.77 -.00682801
    16268  -.0003410162  .067925915  60.37  .00029166
    16269             .   .06046037  81.68          .
    16270             .  -.19248436 118.62          .
    16271             .   .08850786  40.17 -.00396609
    16272   .0042191767  .014100888 113.13  .00276665
    16273     .00870292    .2632147 324.83  .00808184
    16274    -.01636464    -.344536  187.1 -.01562203
    16275   .0046544634    .2210378      0  .00353599
    16276             .   .05127193 221.74          .
    16277             .  -.26678687 120.89          .
    16278             .    .2210185 109.95 -.00932341
    16279    .008783252   -.0252831   91.8  .00760169
    16280    .007231825  -.17771873  70.81  .00628228
    16281     .01423394   .05900541   90.4  .01296797
    16282  -.0012726767   .05729766 187.06 -.00102673
    16283             . -.022344263 192.76          .
    16284             .  -.02866241   76.2          .
    16285             .   .17142993 221.81  .00017013
    16286    .003154181  -.14051646 101.81  .00264746
    16287   -.004890395  -.25682688 296.88  -.0049213
    16288    .001201618    .1975079  211.1  .00093802
    16289    -.01725282   -.0490886  174.4 -.01626284
    16290             .    .1140014 105.11          .
    16291             .   .05550234 100.87          .
    16292             .   -.1717474  106.9 -.00601042
    16293    .008419858    .2153931 128.45  .00781587

    Comment


    • #3
      It does not matter much what you call it: a data problem is also an econometric problem if you are doing econometrics.

      For your regression to work there must be observations in which all the variables named have non-missing values (and in any case you need the number of complete observations to exceed comfortably the number of parameters estimated). The use of lags here can bite hard.

      A different issue here seems to be that you have daily data but typically only for 4 days a week. You'd improve your situation a little by using a business calendar, I guess, although I have never used one myself.
      Last edited by Nick Cox; 01 Feb 2023, 05:23.

      Comment


      • #4
        Thanks Nick,

        What do you mean by a business calendar? Do you mean dropping weekend days where there is no financial data, and continuing like that?

        Comment


        • #5
          To spell out the point about gaps, the data follow a pattern ++++***++++*** where + is present and * is missing. Let us take that example and write it as 1234***8 9 10 11***

          You want lags 1 2 3 4 5 all to be exemplified, but

          for observation 1 that means 2 3 4 5 6 all to be present -- not so

          for observation 2 that means 3 4 5 6 7 all to be present -- not so

          for observation 3 that means 4 5 6 7 8 all to be present -- not so.

          for observation 4 that means 5 6 7 8 9 all to be present -- not so.

          Perhaps there is a quicker proof than by covering all cases, but your request for lagged variables with those lags makes it inevitable that you have no qualifying observations with that tsset.

          You need a business calendar!

          Note. A quicker demonstration is that you need uninterrupted blocks of 7 consecutive non-missing values to be present for a value and the following six lags all to be present. Sometimes you have to follow a problem in a complicated way before you can see the much simpler way that was no doubt evident to others at the outset.
          Last edited by Nick Cox; 01 Feb 2023, 06:23.

          Comment


          • #6
            By business calendar I mean the functionality explained in documentation found by

            Code:
            . search business calendar
            and the hint in #3 is that I recuse myself from questions about them. It's about more than dropping weekends at that alone will not solve the problem.

            Comment


            • #7
              Ok thank you, is it advisable to start a new thread if I encounter issues with the business calendar?

              Comment


              • #8
                Absolutely. Put "business calendar" in the title.

                Comment

                Working...
                X