I have prepared a needle graph using sgplot. The graph is okay
title 'Confidence Interval Range ';
proc sgplot data=boot2 ;
/*highlow x=ratio low=low high=high / type=line;*/
highlow x=ratio low=lower_ci high=upper_ci / type=bar
lineattrs=(color=black) name='a' attrid=Mono;
yaxis label='CI range' grid;
xaxis label='Ratio KaT/KaR' grid values =(0.5 to 2.1 by 0.1);
keylegend 'a' / location=inside position=bottom;
run;
and includes my variables CI range and ratio. However the data set (boot2) has block which I use to categorize my data. All blocks currently appear in the graph. My question is there a way to annotate and change the code to allow either the color or line types based upon block to be represented more clearly in the graph?
A sample of data is below containing my variables.
Group Block Upper_CI Lower_CI Ratio
1 0 84 80 0.62
1 0 85 81 0.63
1 0 88 85 0.7
1 0 100 99 0.8
1 0 108 106 1.25
1 0 109 106 1.3
1 0 113 109 1.5
1 0 122 115 2
1 0 125 116 2.1
1 1 104 102 0.62
1 1 104 101 0.63
1 1 104 101 0.7
1 1 90 88 0.8
1 1 98 96 1.25
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.