%let n=50; options nonotes; goptions targetdevice=pscolor; data a; do rep = 1 to 50000; Y=0; do t = 1 to &n ;Y1=Y; Y=Y+normal(6477025); D=Y-Y1; output; end; end; proc reg noprint data=a outest=betas covout; model Y=Y1/noint; model Y=Y1; model Y=t Y1; by rep; proc print data=betas(obs=12); run; data tests; set betas; retain; if _TYPE_="PARMS" then rho_1=Y1-1; if _NAME_="Y1" then do; tau =Rho_1/sqrt(Y1); rhotest= &n*rho_1; n=&n; keep tau rhotest _MODEL_ n; output; end; /* data alltests; set tests; */ *<- use on first run; proc append base=alltests data=tests; *<- use on subsequent runs ; proc sort; by _MODEL_; data anno; xsys="2"; ysys="1"; when = "A"; function="move"; X=0; Y=100; output; function="draw"; color="green"; size=8; Y=0; output; proc gslide; title h=1.5 " Tau &n(Rho-1) "; note j=center "Top=no mean Middle = mean removed Bottom=trend removed"; proc gchart data=alltests annotate=anno; vbar tau/midpoints=-6 to 4 by .1; by _model_; vbar rhotest/midpoints=-30 to 4 by .5; run; proc greplay tc=tempcat nofs igout=work.gseg; tdef six des='Six panels' 1/ llx = 0 lly = 60 ulx = 0 uly = 90 urx = 48 ury = 90 lrx = 48 lry = 60 2/llx = 52 lly = 60 ulx = 52 uly = 90 urx =100 ury = 90 lrx =100 lry = 60 3/llx = 0 lly = 30 ulx = 0 uly = 60 urx = 48 ury = 60 lrx = 48 lry = 30 4/llx = 52 lly = 30 ulx = 52 uly = 60 urx =100 ury = 60 lrx =100 lry = 30 5/llx = 0 lly = 0 ulx = 0 uly = 30 urx = 48 ury = 30 lrx = 48 lry = 0 6/llx = 52 lly = 0 ulx = 52 uly = 30 urx =100 ury = 30 lrx =100 lry = 0 7/ llx = 0 lly = 0 ulx = 0 uly = 100 urx =100 ury = 100 lrx =100 lry = 0 ; template = six; treplay 1:gchart 2:gchart1 3:gchart2 4:gchart3 5:gchart4 6:gchart5 7:gslide; run ; quit;