I've seen a few posts along these lines but have yet to figure this out. I've don'e an analysis on differences between cropping systems and just want to graph the data (mean, stderr) and indicated significantly different systems using LSD-like categories. I'm using the limitstat=sterr to get my error bars and have seen that I can use datalabel= to get labels but it appears to be one or the other.
Is there an easy way to get both of these in the graph, without having the data labels appear below the bars (see attached fig). My code is below, thank you.
data dlabel;
set stab_graph;
if (system eq 'CC') then dlabel="C";
if (system eq 'CS') then dlabel="B";
if (system eq 'CSW') then dlabel="C";
if (system eq 'CAAA') then dlabel="A";
if (system eq 'CoAA') then dlabel="B/C";
if (system eq 'PAST') then dlabel="B";
run;
proc sgplot data=dlabel noautolegend;
title 'Cropping System Stability: 1993 - 2018';
vbar system / response=stability
stat=mean
limitstat=stderr
datalable=dlabel;
xaxis type=discrete values=('CC' 'CS' 'CSW' 'CAAA' 'CoAA' 'PAST');
run;
And you just want the dlabel values to be on tup of the upper limit, correct? You do not want the actual lower/upper numeric values in the plot as I understand it?
That is correct.
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.