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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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