options crt; ? 2e6 in return; freq m; smpl 78:1 87:12; rename @nob nobtot; ? rename is an alternative to set, for retaining ? a variable under a special name rpmark = market - rkfree; set nrest = 2; set dfunr = nobtot-4; supres smpl; ? turn off printing of each SMPL in the loop regopt(pvprint) chow; ? automated Chow test ? Since we are running so many regressions below, we will ? turn off a few of the default 4.4 diagnostics, to speed ? things up a bit. regopt(nocalc,resetord=0,dwpval=approx) lmhet jb; dot mobil texaco ibm dec datgen coned psnh weyer boise ?motor ? skip Motorola for now, because it is defined ? from 76:1 to 85:12, unlike the other 16 companies tandy panam delta contil citcrp gerber genmil; smpl 78:1 87:12; rp. = . - rkfree; olsq rp. c rpmark; rename @chow chow; ? save results for comparison rename %chow pchow; ? The code below computes the Chow test by hand rename @ssr ssrest; smpl 78:1 82:12; olsq(silent) rp. c rpmark; rename @ssr ssunr1; smpl 83:1 87:12; olsq(silent) rp. c rpmark; rename @ssr ssunr2; set ssunr = ssunr1+ssunr2; set fstat = ((ssrest-ssunr)/nrest) / (ssunr/dfunr); cdf(f,df1=nrest,df2=dfunr) fstat pf; print chow,fstat pchow,pf; enddot; ? ? F-tests by industry ? title 'Computers'; ftind3 rpibm rpdec rpdatgen; ? use Proc ftind3 defined below ftind3p rpibm rpdec rpdatgen; ? also try Proc ftind3p defined below title 'Oil'; ftind rpmobil rptexaco; ? use Proc ftind defined below title 'Electric Utilities'; ftind rpconed rppsnh; title 'Forest Products'; ftind rpweyer rpboise; ?title 'Electronic Components'; ? skip for now, due to Motorola sample ? ftind rpmotor rptandy; title 'Airlines'; ftind rppanam rpdelta; title 'Banks'; ftind rpcontil rpcitcrp; title 'Foods'; ftind rpgerber rpgenmil; ? proc ftind co1 co2; set nco = 2; supres @logl @nob @coef; ? turn off output since we've seen it already freq m; smpl 78:1 87:12; olsq(silent) co1 c rpmark; set ssunr = @ssr; olsq(silent) co2 c rpmark; set ssunr = ssunr + @ssr; mmake mrp co1 co2; ? stack data mmake mmark rpmark rpmark; freq n; set t = nobtot*nco; smpl 1,t; unmake mrp strp; unmake mmark stmark; nosupres @logl @nob @coef; ? turn output back on olsq(silent) strp c stmark; rename @ssr ssrest; set nrest = 2*(nco-1); set dfunr = t-2*nco; set fstat = ((ssrest-ssunr)/nrest) / (ssunr/dfunr); cdf(f,df1=nrest,df2=dfunr) fstat; endp; ? proc ftind3 co1 co2 co3; set nco = 3; supres @logl @nob @coef; ? turn off output since we've seen it already freq m; smpl 78:1 87:12; olsq(silent) co1 c rpmark; set ssunr = @ssr; olsq(silent) co2 c rpmark; set ssunr = ssunr + @ssr; olsq(silent) co3 c rpmark; set ssunr = ssunr + @ssr; mmake mrp co1 co2 co3; ? stack data mmake mmark rpmark rpmark rpmark; freq n; set t = nobtot*nco; smpl 1,t; unmake mrp strp; unmake mmark stmark; olsq(silent) strp c stmark; rename @ssr ssrest; set nrest = 2*(nco-1); set dfunr = t-2*nco; set fstat = ((ssrest-ssunr)/nrest) / (ssunr/dfunr); cdf(f,df1=nrest,df2=dfunr) fstat; endp; ? ? For variety, we could also do this with the panel command, to test ? the pooling of the 3 companies (TOTAL vs. BYID) ? proc ftind3p co1 co2 co3; set nco = 3; freq m; smpl 78:1 87:12; mmake mrp co1 co2 co3; ? stack data mmake mmark rpmark rpmark rpmark; freq n; set t = nobtot*nco; smpl 1,t; unmake mrp strp; unmake mmark stmark; panel(t=nobtot,byid,nobet,nowithin,novarc) strp c stmark; set nrest = 2*(nco-1); set dfunr = t-2*nco; set fstat = ((@ssrt-@ssri)/nrest) / (@ssri/dfunr); cdf(f,df1=nrest,df2=dfunr) fstat; ? should equal Ai,Bi vs. A,B test that was printed by PANEL endp;