goptions reset=all; goptions targetdevice=pscolor; proc greplay nofs; igout=work.gseg; delete _all_; ** clear out the existing graphics catalog ***; data VPI; %let n=100; Y1=0; Gamma=0; Q=0; SSE=0; do rep = 1 to 30; do i = 1 to &n; Y=Y1+normal(6431827); gamma = gamma+(y1/&n)*(y1/&n); Q=Q + (y-y1)*y1/&n; SSE=SSE+(y-y1)*(y-y1); y1=y; end; do step = 1 to 100; Z = .001*(1.083)**step; G_Z = log(z)- 2*Z*Q - Z*Z*gamma ; if g_z < -10 then g_z=.; DG_DZ = 1/z -2*Q -2*Z*gamma; if DG_DZ>10 then DG_DZ=.; if DG_DZ<-10 then DG_DZ=.; output; end; end; proc gplot; plot G_Z*Z=rep/nolegend; title "G(Z) Log(likelihood)"; symbol1 v=none i=join w=3 r=4; label G_Z = "Gz"; proc gplot; plot DG_DZ*Z=rep/vref=0 nolegend; title " "; label DG_DZ = "dG"; proc greplay tc=tempcat nofs igout=work.gseg; tdef two des='Two panels' 1/ llx = 5 lly = 48 ulx = 5 uly = 98 urx = 95 ury = 98 lrx = 95 lry = 48 2/llx = 5 lly = 2 ulx = 5 uly = 45 urx = 95 ury = 45 lrx = 95 lry = 2 ; template = two; treplay 1:gplot 2:gplot1; run ; quit;