Announcement

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

  • r(2000): no observations URGENT

    Please help, I am running against time and I apologise if I missed any formatting/gidance on posting here.

    so I have to run a predictive regression for intraday time series data.

    but fuller variable keeps resulting r(2000) no observations error.

    how can I fix this? the datetime variable is already in %tc format and declaring it as tsset worked fine.

    Thanks in advance!

    I noticed another post no this, but frankly I didn't understand at all!

    sample code: --------
    clear
    import excel using "filepath.xlsx", sheet("Sheet1") firstrow

    * Create a copy of uniquedate and format it to retain only dates
    gen double dates = floor(uniquedate)

    * Display the new variable
    list uniquedate dates in 1/10

    tsset dates

    dfuller variable
    (results in r(2000) error, no observations

    --------

    with this code, scatter plot, tsline etcetera work fine....




  • #2
    ...if I missed any formatting/gidance on posting here.
    You missed quite bit of guidance, and, as a result, your post has very little chance of getting a timely and helpful response.

    One of the clear mistakes in your post us putting "urgent" (in all caps, no less!) in your title. Statalist is not a paid helpline. It is a community of Stata users who help each other on a "when it is convenient" basis. Your urgency in no way obligates, nor even encourages anyone to prioritize responding to you. In fact, some people I know find it off putting and will, in principle, not even open a post that claims to be urgent. So, my first suggestion is that when you repost, start a new thread, and be sure not to say "urgent." Bear in mind also that it is the weekend, and the pace is slower. If your situation truly is urgent, this may not be the best place to seek help. But that's up to you to decide.

    Next, you don't provide enough information for anybody to give you a useful answer. There are many reasons you might be encountering this problem, and to distinguish among them, someone trying to help you would need to see, at a minimum:
    1. Example data that reproduces the problem you are having. And the only truly useful way to show example data is by using the -dataex- command. Don't even think about using a screenshot from the data editor. Nor will any -list- output or table you might type provide all of the needed information. If you are running version 18, 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.
    2. Equally important, you need to show the exact command that is giving you the error message and the entire response to it that Stata gave you. Show it exactly: edit nothing and leave nothing out. The best way to do that is to copy it directly from the Results window or your log file and paste it into the forum. It is also a courtesy to those who read your post to surround that by code delimiters to that it will align well for easy reading.
    3. Since your problem involves time series data, you also need to show the exact -tsset- command that you used, and you also need to show the response that Stata gave to that command. The details may well reveal the crux of your problem. Just saying that -tsset- "worked fine" conveys no helpful information. Details and specifics are needed. (In fact, you didn't even have to say that -tsset- worked at all: we know that because if it hadn't, you would have gotten a very different error message from -dfuller-.)
    Had you read the Forum FAQ before posting, which everybody is asked to do when they join, you would have known these things. Better late than never: read them now--there is other guidance there that will serve you well going forward. The guidance is there to maximize what you will get out of your Statalist experience: it is distilled wisdom about the most effective ways to ask questions in this Forum, so as to maximize your chance of getting a rapid and useful response.


    Comment


    • #3
      I agree with all of the comments and advice of Clyde Schechter Indeed, at a different time of day I might have written first to the same effect.

      One guess is possible. If you declared a date-time variable with time step 1 millisecond (ms) to tsset then lag 1 is 1 ms before, and so on.

      If your data have a different time step, even 1 minute or 1 hour, you need to spell that out to tsset with its delta() option. Otherwise Stata can only see widely spaced data points and infer large gaps between them.

      r(2000) often means "no observations to do what you are asking".

      Comment

      Working...
      X