Hello, new day new question. This time I want to calculate bandwidth of a histogram inside a makro which also creates the histogram. Here is some data I'm using: data plot;
do i =1 to 1000;
y = rannor(1234) ;
y1 = rannor(1235) ;
output;
end;
run;
data varCorr;
input correlation ;
datalines;
4
; The data is the used in the macro: %MACRO createPlot(dataPlot, varCorr, obs );
data bandwidth;
set &varCorr;
b = 3.5 * y/(&obs**(1/3));
%let b = %SYSEVALF(b);
proc sgplot data=&dataPlot;
histogram y / binwidth=b transparency=0.5;
histogram y1 / binwidth=b transparency=0.5;
density y / type=kernel lineattrs=GraphData1;
density y1 / type=kernel lineattrs=GraphData2;
xaxis label="bla" ;
keylegend "yK" "yG" / across=1 position=TopRight location=Inside;
run;
%MEND; I want to calculate the b first and use it later in the proc sgplot when plotting the histogram. I think the problem is in this line: %let b = %SYSEVALF(b); But I cannot figure it out how to fix it by myself. Thanks for your help.
... View more