options memory=12 limwarn=0 crt ; ? ? ========================= IPS0TEST ============================ ? ? One Variable Time Series Process for Sales, R&D, Investment, ? Employmemt, and Profits. ? Im, Pesaran, & Shim test for unit roots. ? Hall-Mairesse March 2001. ? ?read (file="bchmussc.dta") ; ?read (file="/bhresearch/us/unit/bchmfrsc.xls") ; read (file="/bhresearch/japan/bchmcln.dta") ; clean = 1 ; ? ? Set up the data to be used - the series is called y. ? supres smpl ; const t 12 ; set nobt = @nob ; set nob = nobt/t ; ? ? Set up id and trend. ? trend(pstart=1,period=t) trend ; select trend=1 ; trend id ; select trend>1 ; id = id(-1) ; select trend>0 ; dummy trend yrdum ; dot s r i l y; ? Loop over 5 variables - unit root tests will be computed for each. smpl 1 nobt ; msd log. ; y = log. ; set j = 0 ; set n2 = 0 ; set n3 = 0 ; set nt2 = 0 ; set nt3 = 0 ; ? ? Remove firm-specific means. ? olsq (silent) y yrdum ; copy @res y ; ? ? Loop over individual unit root tests (t time periods per obs). ? do ind = 1 to nobt by t ; set ibeg = ind ; set iend = ind+t-1 ; smpl ibeg iend ; msd (pair,silent) y ; set good = @nobmsd(1)=t ; if good ; then ; do ; set j = j+1 ; unit (notrend,nows,silent) y ;? Test with no trend. set adf0(j) = @tabdf(2,1) ; unit (nows,silent) y ; ? Unit root test with trend. set adf0t(j) = @tabdf(2,1) ; set adfid(j) = id(ind) ; set alpha(j) = @tabdf(4,4) ; if alpha(j)>1000 ; then ; set outlier = ind ; set delta(j) = @tabdf(6,4) ; enddo ; enddo ; ? Now compute the IPS tests by averaging the individual tests. set nob = j ; print nob ; smpl 1 nob ; msd adf0; ? Tables to standardize zp2 and zp3 are in IPS paper. set zp0not = sqrt(j)*(@mean(1)+1.506)/sqrt(1.04) ;? p=0 or 2 or 3 t=12 cdf (print,lowtail,normal) zp0not crit ; ? Do the same thing for the test with a trend. ? hist alpha ; ? hist delta ; msd alpha delta ; msd adf0t ; set zp0t = sqrt(j)*(@mean(1)+2.166)/sqrt(1.08) ; cdf (print,lowtail,normal) zp0t crit ; enddot ; print outlier ;