BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
walkerel
Calcite | Level 5
TITLE1 "Hypertension-Related Death Rates by State";
PROC SGPLOT DATA = HypRslt.StatePercents;
		VBAR StateCd / Group = ColPercent
							  GROUPDISPLAY=cluster
							  DATALABEL = ColPercent
							  ;
							  
		
	REFLINE 1.8
		/ AXIS = Y
		  LABELLOC = inside
		  LINEATTRS=(COLOR = INDIGO
		  			 PATTERN = SHORTDASH)
		  LABEL = 'National Average = 1.8';
		  
	XAXIS LABEL = 'State Code'
		  LABELATTRS= (WEIGHT = BOLD)
		  ;
		  
	STYLEATTRS DATACOLORS= (LIGHTSALMON)
			   DATACONTRASTCOLORS= (BLACK);
			   
	YAXIS LABEL = 'PERCENT'
		  OFFSETMIN= 0
		  LABELATTRS= (WEIGHT = BOLD)
		  VALUES = (0,1,2,3,4)
		  GRID;

Hi all,

 

When I submit the code above, SAS is generating a flat bar graph like Graph 1 attached below. What code do I need to fix to get SAS to produce a graph like Graph 2 attached below? (All of the data used are fictitious data that were created for the sole purpose of illustrating a concept). Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Jagadishkatam
Amethyst | Level 16

Please try the below code, replace the group= with response and it should generate the expected output

 

PROC SGPLOT DATA = HypRslt.StatePercents;
		VBAR StateCd / response= ColPercent
							  GROUPDISPLAY=cluster
							  DATALABEL = ColPercent;
run;
quit;

 

 

Thanks,
Jag

View solution in original post

1 REPLY 1
Jagadishkatam
Amethyst | Level 16

Please try the below code, replace the group= with response and it should generate the expected output

 

PROC SGPLOT DATA = HypRslt.StatePercents;
		VBAR StateCd / response= ColPercent
							  GROUPDISPLAY=cluster
							  DATALABEL = ColPercent;
run;
quit;

 

 

Thanks,
Jag