DATA Step, Macro, Functions and more

correct graphics program (continue)

Reply
Contributor
Posts: 43

correct graphics program (continue)

[ Edited ]
Data MCint;
call streaminit(12345);
do isim=1 to 10000;
    Ux = rand("UNIFORM");
    Uy = rand("UNIFORM");
    Under = (Uy<=sqrt(1-Ux**2));
    drop isim;
    output;
    end;
run;

ODS OUTPUT OneWayFreqs=data_freq;
proc freq;
table Under;
run;

proc print data =data_freq;run;

data _null_; 
set data_freq;
if under=1;
PI_est=4*Percent/100;
prop_est=Percent/100;
SE_PI_EST=4*sqrt(prop_est*(1-pop_est)/10000);
PI_CI_Low=PI_est-2*SE_PI_EST;
PI_CI_Up=PI_est-2*SE_PI_EST;
file print;
put ' ------------------------------------------';
put ' | MC Integration estimate of PI          |';
put ' ------------------------------------------';
put ' PI(estimate)=' PI_est;
put ' SE[PI(estimate)]=' SE_PI_EST;
put ' Approx. 95% CI=' PI_CI_Low' ,' PI_CI_Up;
put ' ' ;
put ' Based on 10,000 simulated points.' ;
put ' ------------------------------------------' ;
run;

ods graphics / imagename="Circle" antialiasmax=11000;
proc sgplot data=MCint aspect=1;
scatter x=Ux y=Uy / group=Under markerattrs=(symbol=Plus size=5);
xaxis min=0 max=1;
yaxis min=0 max=1;
run;

It a question after the previous question and the answer is above. I found that I can't control color of the dot in the program when I use the previous command. Where should I rewrite the code?

  ods graphics / reset width=50px height=300px;
  symbol1 value=dot color=black;
  symbol2 value=dot color=yellow;
 
Super User
Posts: 10,044

Re: correct graphics program (continue)

Posted in reply to karen8169
ods graphics /imagename="Circle" antialiasmax=11000;
proc sgplot data=MCint aspect=1;
styleattrs datacontrastcolors=(black yellow);
scatter x=Ux y=Uy / group=Under markerattrs=(symbol=circlefilled size=5);
xaxis min=0 max=1;
yaxis min=0 max=1;
run;

Ask a Question
Discussion stats
  • 1 reply
  • 121 views
  • 0 likes
  • 2 in conversation