You can create another macro variable that is rounded to what you want, and then afterwards you can use the label statement in refline to show the formatted value. The macro variable can be rounded to the number of decimal places you want by using the picture format. There could be a quicker way to do this, but this way works too. Here is an example. data test; do i = 1 to 60; do j= 1 to 2; subject = i; m1 = rand("normal", 20, 2); m2 = m1 + rand("uniform"); output; end; end; run; * Creating picture format; proc format; picture reffmt (round) 0-9 = 9.999 10-99 = 99.999 100-999 = 999.9999 1000-9999 = 9999.999 10000-99999 = 99999.999; run; %let refline1 = 20.52135467; %let refline1fmt = %sysfunc(putn(&refline1, reffmt.)); proc sgplot data = test; refline 10 30 / axis = y lineattrs = (color = red pattern = 2); * Reference line of limits; refline &refline1. / axis = y lineattrs = (color = blue) label="&refline1fmt."; * Mean reference line; scatter x = m1 y = m2 / group = subject; yaxis min = 0 max = 40; * yaxis range; run;
... View more