Announcement

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

  • Testing for structural break for time series data

    Hello everyone,

    I have a time series data where I regress air transport traffic against GDP, oil price, and FX rates. I have observations for each variable from 2000 to 2019. I wanted to know if there was a structural break in the time series for GDP and undertook the following command
    Code:
    regress historicalpassengers gdp, vce(robust)
    where I obtained the following output:

    Code:
     
    Linear regression Number of obs = 20
    F(1, 18) = 1742.79
    Prob > F = 0.0000
    R-squared = 0.9836
    Root MSE = 3.4e+06
    Robust
    historical~s Coef. Std. Err. t P>t [95% Conf. Interval]
    gdp 379.8068 9.097881 41.75 0.000 360.6928 398.9207
    _cons -2.81e+07 2504966 -11.23 0.000 -3.34e+07 -2.29e+07
    I then ran
    Code:
    estat sbsingle
    and got the following:

    Code:
    . estat sbsingle
    insufficient observations at the specified trim level
    r(198);
    Wondering if what I did was right? Thank you.

  • #2
    Judging by the error, you don't have enough observations (N = 20). I'm not sure how appropriate it is to adjust the trim level, but you can try something like this to see what level allows the test to run:

    Code:
    forvalues x = 1/30 {
        cap estat sbsingle,  trim(`x')
        if _rc == 198 {
            continue 
        }
        di "`x'"
        continue, break
    }

    Comment


    • #3
      Originally posted by Justin Blasongame View Post
      Judging by the error, you don't have enough observations (N = 20). I'm not sure how appropriate it is to adjust the trim level, but you can try something like this to see what level allows the test to run:

      Code:
      forvalues x = 1/30 {
      cap estat sbsingle, trim(`x')
      if _rc == 198 {
      continue
      }
      di "`x'"
      continue, break
      }
      Thanks Justin. For the syntax you provided above, is there a part I can change to adjust the trim level?

      Comment


      • #4
        That's what the code does essentially. It finds the trim level once the 'insufficient observations at the specified trim level' error is no longer encountered. Note that was for demonstration, I can't comment on whether or not that's an appropriate course of action. Here's a modified version

        Code:
        forvalues x = 1/30 {
            cap estat sbsingle,  trim(`x')
            if _rc == 198 {
                continue 
            }
            local tlevel = `x'
            continue, break
        }
        
        estat sbsingle,  trim(`tlevel')

        Comment


        • #5
          I have a question on structural break based on this. After having tested my time series data for structural break, I found that in my n=20 observations, nearly every year has a structural break. This weakens my next step of using a dummy to overcome the structural break problem, to 'absorb’ the structural break. Example:

          I am interested in b1 in regression y=a +b1X1 +b2X2
          • I identify year=2 is a structural break. create dummy=1 if year=2
          • New model: y=a+b1x1 + b2(x1*dummy) + b2x2
          • Here, b1 is the estimate during ‘normal times’, and b2 is estimate during ‘break'
          Given that I have a structural break in every year, the effect of including the dummy is weaker (I think). Wondering if there are any solutions to this?

          Comment


          • #6
            Hello everyone

            I am trying to estimate a non-linear model with STATA 15, after the specification of the transition variable, when I launch the estimation of my model on the data which are spread over the period 1990-2020, I have the following error message :

            "not enough observations at the specified trim level".

            I have tried all the proposed solutions in this forum but I always get the same error message. Is there a solution to solve this problem?

            Thank you in advance

            Comment

            Working...
            X