Announcement

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

  • Stata: unit-root test on unbalanced panel data

    This question is cross posted here.

    I have the following data:

    Code:
        import excel "\\dfs\wiwi\home\Perdue\Desktop\statafiles\unitroot.xls", sheet("Sheet1") firstrow clear
        
        encode cid, gen(panel_id)
        
        drop cid
        
        xtset panel_id date
               panel variable:  panel_id (unbalanced)
                time variable:  date, 2006 to 2014
                        delta:  1 unit
        
        xtunitroot fisher leg_totalbills, dfuller trend demean lags(1)
        performing unit-root test on first panel using the syntax
        dfuller leg_totalbills, trend  lags(1)
        returned error code 2000
        r(2000);
        
        count if mi(date, years_exp, leg_totalbills, panel_id)
            0
    I simply need to do a unit-root test. I have tried using R but was unable to find a package that could handle unbalanced panels. I thought that Stata would be easier but I have encountered consecutive obstacles. This question had evolved from here and here.

  • #2
    John Michael:
    the error code r(2000) creeps up when your code does not match your observations (missing values is one possible cause, but not the only one).
    I'm not familiar with unit-root test; however, I would take a look at -lags- as a possible source of problem.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo,

      According to the theoretical description of unit root test and the examples, unit root test may be to do on the dependent variables. however I can see that on each independent variable separately is also applied. Do you have a theoretical article where I can read more about it. It is not still clear for me why I should do for independent variables. Then what happen if you have the situation where one of the variables show that one of the panel is not stationary? I really appreciate any comments. Regards

      Comment

      Working...
      X