Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I will give example using <code>urca</code> package in <code>R</code>. </p> <pre><code>library(urca) data(npext) # This is the data used by Nelson and Plosser (1982) sample.data&lt;-npext head(sample.data) year cpi employmt gnpdefl nomgnp interest indprod gnpperca realgnp wages realwag sp500 unemploy velocity M 1 1860 3.295837 NA NA NA NA -0.1053605 NA NA NA NA NA NA NA NA 2 1861 3.295837 NA NA NA NA -0.1053605 NA NA NA NA NA NA NA NA 3 1862 3.401197 NA NA NA NA -0.1053605 NA NA NA NA NA NA NA NA 4 1863 3.610918 NA NA NA NA 0.0000000 NA NA NA NA NA NA NA NA 5 1864 3.871201 NA NA NA NA 0.0000000 NA NA NA NA NA NA NA NA 6 1865 3.850148 NA NA NA NA 0.0000000 NA NA NA NA NA NA NA NA </code></pre> <p>I will use <code>ADF</code> to perform the unit root test on <code>industrial production index</code> as an illustration. The <code>lag</code> is selected based on the <code>SIC</code>. I use trend as there is trend in the date . </p> <pre><code> ############################################### # Augmented Dickey-Fuller Test Unit Root Test # ############################################### Test regression trend Call: lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag) Residuals: Min 1Q Median 3Q Max -0.31644 -0.04813 0.00965 0.05252 0.20504 Coefficients: Estimate Std. Error t value Pr(&gt;|t|) (Intercept) 0.052208 0.017273 3.022 0.003051 ** z.lag.1 -0.176575 0.049406 -3.574 0.000503 *** tt 0.007185 0.002061 3.486 0.000680 *** z.diff.lag 0.124320 0.089153 1.394 0.165695 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.09252 on 123 degrees of freedom Multiple R-squared: 0.09796, Adjusted R-squared: 0.07596 F-statistic: 4.452 on 3 and 123 DF, p-value: 0.005255 Value of test-statistic is: -3.574 11.1715 6.5748 Critical values for test statistics: 1pct 5pct 10pct tau3 -3.99 -3.43 -3.13 phi2 6.22 4.75 4.07 phi3 8.43 6.49 5.47 </code></pre> <p>#Interpretation: <code>BIC</code> selects the <code>lag 1</code> as optimal lag. The test statistics <code>-3.574</code> is less than the critical value <code>tau3</code> at 5 percent (-3.430). So, the null that there is an unit root is is rejected only at <code>5 percent</code>.</p> <p>Also, check the free forecasting book available <a href="http://otexts.com/fpp/8/1/" rel="nofollow">here</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload