BookmarkSubscribeRSS Feed
grsanford
Fluorite | Level 6

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;

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

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?

grsanford
Fluorite | Level 6

That is correct.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 925 views
  • 0 likes
  • 2 in conversation