Page 1 of 1

Ng - Perron UR test loop

Posted: Sun Aug 02, 2020 6:48 pm
by kdom20
I am trying to compute the Ng - Perron unit root test for many series.

Based on an ADF loop posted in this forum, I tried the following but it does not produce results for all the tests. Any help in fixing this is appreciated. Thanks.

Code: Select all

group g * not resid 'put every series in the workfile into a group Table NgP for !i=1 to g.@count 'loop through every series in the first group %name = g.@seriesname(!i) 'grab the current series name uroot(np, hac=ardt, lagmethod=maic, maxlag=6,save=level1) {%name} NgP(1,1+!i)=%name NgP(2, 1+!i)= level1(3,1)' uroot(exog=trend, np, hac=ardt, lagmethod=maic, maxlag=6,save=level2) {%name} NgP(3, 1+!i)= level2(3,1) next