*********************************************************************** ** The following will explain how to replicate the results of ** ** "Comments on 'Assessing Applied Econometric Results' by Carl ** ** F. Christ" by David A. Dickey, in the March/April "Review." ** ** The programs below were written in SAS. These programs will ** ** replicate Figures 1,2, and 3 of the comments. ** *********************************************************************** Figure 1: This SAS program was used to replicate the Monte Carlo that generated the probabilities of quadrupling for the table. See the paper for a description of the Monte Carlo. Following the Monte Carlo program is the SAS program that creates the figure. The data for Figure 1 can be found in the corresponding data file. Since you will be running your own Monte Carlo, the results will not match exactly with the results we obtained. ======================================================================= ** NOTE: Depending on the capabilities of your system, this program may not execute fully. PROC IML; NUMRUNS =10000; RHONUM1=0.5; RHONUM2=0.9; K1=1; k2=4; EPSILON=J(8,1,0); DO RHO=RHONUM1 to RHONUM2 by 0.1; DO K= K1 TO K2 by 1; COUNT=0; DO Q=1 TO NUMRUNS; ZN8=0; EN1=0; DO J=1 TO K; DO I=1 TO 8; EPSILON(³I,1³)=RANNOR(0); * Draws 8 random errors; END; Z=0; DO I= 1 TO 8; Z=Z+(EPSILON(³9-I,1³)*(RHO**(I-1))); * Creates Z(n+8); END; ZN8=ZN8+(Z**2); * Sum of k values of Z(n+8)**2; EN1=EN1+(EPSILON(³2,1³)**2); * Sum of k values of e(n+1)**2; END; IF ZN8>(16*EN1) THEN COUNT=COUNT+1; * Summation of the number of; END; * times Z(n+8)**2 > 16(e(n+1)**2); PROB=COUNT/NUMRUNS; * Probability; PRINT PROB K RHO; END; END; ===================================================================== ===================================================================== ** this is the SAS program to create the figure; GOPTIONS DEVICE=IBM3179 TARGETDEVICE=OLDZETA8 GSFMODE=REPLACE GEPILOG='0D0A'X GSFLEN=128 ROTATE=PORTRAIT RESET=GLOBAL GUNIT=PCT NOBORDER HTEXT=2.3; options pagesize=130; data a; infile( * the relevant data set from the data file ); input num rho prob; proc g3d data=a gout=plot; scatter num*rho=prob / zmin=0.014 shape='prism'; run; GOPTIONS DISPLAY; ===================================================================== Figures 2 and 3: This SAS charts program is used to generate the three dimensional charts. In order to obtain the second graph, you will have to adjust the ROTATE and TILT commands in the following program. ===================================================================== GOPTIONS DEVICE=IBM3179 TARGETDEVICE=OLDZETA8 GSFMODE=REPLACE GEPILOG='0D0A'X GSFLEN=128 ROTATE=PORTRAIT RESET=GLOBAL GUNIT=PCT NOBORDER HTEXT=2.3; options pagesize=130; **** CREATES THE GRID PORTION OF THE 3-D GRAPH. THE SLOPE ****; **** OF THE GRID IS DETERMINED BY REGRESSING M1/GNP ON A ****; **** CONSTANT AND THE INVERSE AAA BOND RATE. ****; data gridpart; LABEL X='1/RAAA'; LABEL Y='YEAR'; LABEL Z='M1/GNP'; do y = 1959 to 1992 by 3; do x = 0.06 to 0.24 by 0.02; z = 0.772222*x + 0.0856666; output; end; end; **** CREATE ANNOTATE DATASETS ****; data actual3d grid3d connect sidewall bottom; set on.dickey3d(keep=year ngnp m1 raaa); invvel = (m1/ngnp); invaaa = (1/raaa); length function $ 4 color $ 5; retain xsys ysys zsys '2' line 1; **** ACTUAL 3-D PLOT ****; do; color='red'; x=year; y=invaaa; z=invvel; if _n_ = 1 then function='move'; else function='draw'; output actual3d; end; **** PROJECTION OF 3-D PLOT INTO GRID ****; do; color='blue'; z=0.772222*y + 0.0856666; output grid3d; end; **** PROJECTION INTO SIDE WALL ****; do; color='green'; y=0.24; z=invvel; output sidewall; end; **** PROJECTION INTO FLOOR ****; do; y=invaaa; z=0.132; output bottom; end; **** LINES CONNECTING ACTUAL 3-D PLOT ****; **** TO PROJECTION INTO THE GRID ****; do; color='black'; z=invvel; function='move'; output connect; z=0.772222*y + 0.0856666; function='draw'; output connect; end; run; data alldata; set actual3d grid3d connect sidewall bottom; proc g3d data=gridpart anno=alldata gout=plot; plot x*y=z / caxis = black ctop = black rotate=79 tilt =73; run; GOPTIONS DISPLAY; ** GOPTIONS DEVICE=OLDZETA8 NODISPLAY HANDSHAKE=XONXOFF ** GSFNAME=GSASFILE; ** PROC GREPLAY IGOUT=PLOT; ** RUN; ====================================================================== **********************************************************************