Announcement

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

  • 'No observations' error

    Dear all,

    I'm trying to conduct a unit root test to my variables using the following code:

    Code:
    xtunitroot llc [variable], trend
    For one of my variables it keeps returning me an "no observations" error. I've learned that this error can occur when the variables have gaps in the data, but this error is happening in a variable that has no gaps. When I summarize the variables, i get the exact same number of observations for each.

    For more information I can say that variables are stored as "double type", witch I think it means that are correctly stored as numeric instead of strings. I also tried to do the same test using variables as logarithms, but the same error for the same variable keeps happening. In logarithms variables change from double to float.

    Also, my data is a panel data, and for each cross (country) the value is the same, but differs from cross to cross.

    Can anyone help me solving this?

    I thank you all in advance.





  • #2
    You need to tell us more about the variables. Show us the results of

    Code:
    xtset 
    and then

    Code:
    describe timevar
    where instead of timevar you write the name of the time variable shown by the first command.

    I'll guess that you have e.g. monthly or quarterly data indexed by a daily date variable.

    Comment


    • #3
      Is this what you asked?

      Click image for larger version

Name:	50943261_237493707127875_447424597403369472_n.png
Views:	1
Size:	12.7 KB
ID:	1480370

      Comment


      • #4
        Your problem is, I believe, a result of the fact that the variable for which you are getting "no observations" is constant within each panel. (For such a variable, the data have no time component and thus are stationary by definition.)

        Consider the following example derived from one in the output of help xtunitroot.
        Code:
        . webuse pennxrate, clear
        
        . xtset
               panel variable:  id (strongly balanced)
                time variable:  year, 1970 to 2003
                        delta:  1 unit
        
        . xtunitroot llc lnrxrate, trend
        
        Levin-Lin-Chu unit-root test for lnrxrate
        -----------------------------------------
        Ho: Panels contain unit roots               Number of panels  =    151
        Ha: Panels are stationary                   Number of periods =     34
        
        AR parameter: Common                        Asymptotics: N/T -> 0
        Panel means:  Included
        Time trend:   Included
        
        ADF regressions: 1 lag
        LR variance:     Bartlett kernel, 10.00 lags average (chosen by LLC)
        ------------------------------------------------------------------------------
                            Statistic      p-value
        ------------------------------------------------------------------------------
         Unadjusted t       -35.0005
         Adjusted t*          1.5094        0.9344
        ------------------------------------------------------------------------------
        
        . generate one = id
        
        . xtunitroot llc one, trend
        no observations
        r(2000);

        Comment


        • #5
          #3 is what I asked for. It doesn't to me solve the problem. Meanwhile focus on #4.

          Comment


          • #6
            Hi,
            I am having the same error. I am working with time series. I destring-ed my variable. variable type is "double" now. I am trying to find out the optimal lag by using "varsoc"
            it's showing me erro "no observation"
            can you please tell me how did you fix it?

            Comment


            • #7
              #2 applies to #6 too. Please show us the results of

              Code:
              tsset
              and

              Code:
              summarize timevar 
              where
              Code:
               timevar
              is to be replaced by your time variable name if different.

              Comment

              Working...
              X