Announcement

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

  • dfuller - no observations r(2000) and gaps in time serie.

    Hi all,

    I'm getting the error above, no observations r(2000) for the ADF test.

    Maybe it is because I'm using hourly data, but haven't tsset it the right way?
    I have data like this: 01jan2016 00:00:00 and the next being 01jan2016 01:00:00.

    Furthermore, where can I see which data im missing?

    I use the following commands:
    gen double Dato_1 = clock(dato, "DMY hm")
    format *1 %23.0f
    format *1 %tc
    tsset Dato_1
    tsset

    tsline spanien
    dfuller spanien, regress lags(1) trend

    Output for tsset:
    time variable: Dato_1, 01jan2016 00:00:00 to 03dec2020 17:00:00
    but with gaps
    delta: .001 seconds


    Hope it makes sense, thanks in advance.

    Kind regards Christian

  • #2
    The default is to take the time step for date-time variables as 1 ms, as tsset shows. You need to

    Code:
    tsset Dato_1, delta(1 hour)
    as
    help tsset explains in detail.

    Comment


    • #3
      Litterally just what i needed, it works just fine now !!! You are the man.

      Thank you so much !!!!

      Comment


      • #4
        Hello everyone,

        I have the same kind of question...
        I have the following code:
        ". tsset Date

        Time variable: Date, 01jan2008 to 01nov2021, but with gaps
        Delta: 1 day

        . tsset

        Time variable: Date, 01jan2008 to 01nov2021, but with gaps
        Delta: 1 day

        . dfuller Date
        no observations

        . dfuller CPI
        no observations
        r(2000);"

        Whereas I do a regression, or even "tsline CPI" it works...

        Could someone help me to fixe this issue please?
        Thanks in advance

        Comment


        • #5
          #4 No data example -- see https://www.statalist.org/forums/help#stata for how to give us one -- but here's my guess, not least because I wouldn't expect a CPI to be issued daily.

          You have monthly data that happen to be referred to daily dates for the first of each month. If you tell tsset they are daily data, then commands can't find e.g. the predecessor to 1 Feb 2008, which would be 31 Jan 2008, or the successor, and so on. So, simple operations like L1. or D1. all yield missings.

          If so, the remedy is to recast to a monthly date and tsset in terms of that.


          Code:
          gen mdate = mofd(Date) 
          format mdate %tm
          tsset mdate

          Comment


          • #6
            Nick Cox Amazing! Thank you so much

            Comment


            • #7
              Hi everyone,
              having pretty much the same issue as others have had with the Dickey-fuller test, and I'm very inexperienced with stata
              I'm working with daily stock return data which has gaps due to the fact that stock markets are closed over the weekends, my do file currently looks like this
              generate trend = _n
              generate time = td(18feb2015) + _n-1
              format time %td
              generate time1 = date(date,"MDY")
              format time1 %td
              tsset time1, daily
              output looks like this
              Time variable: time1, 18feb2015 to 25sep2015, but with gaps
              Delta: 1 day
              when i try to carry out an ADF test on my variables it says
              no observations
              any help would be greatly appreciated

              Comment

              Working...
              X