I must be just not seeing something. I simply want a chart that has a VBAR for each of these attributes grouped by the 'entity':
Entity | OSAT | DP | LTR | MLTP | WADO | TTIA | COMM | TTSE | RSAT |
National | 0.82 | 0.71 | 0.69 | 0.5 | 0.88 | 0.82 | 0.81 | 0.78 | 0.87 |
CENTRAL | 0.83 | 0.74 | 0.72 | 0.48 | 0.89 | 0.83 | 0.82 | 0.8 | 0.88 |
Group | 0.81 | 0.69 | 0.66 | 0.44 | 0.88 | 0.79 | 0.77 | 0.78 | 0.86 |
Dealer1 | 0.88 | 0.76 | 0.73 | 0.37 | 0.89 | 0.81 | 0.8 | 0.81 | 0.9 |
The chart I would like it to look like is attached. This should be very simple but I'm missing it.
Please help!
You need to transpose your data so that you have just three variables: Level, Entity, and Value. For each Level (National, etc.), you should have all Entities and their corresponding Values. The resulting data set should be 36 observation long with three variables. Then, the following SGPLOT code should give you the chart you want:
proc sgplot data=mydataset;
xaxis display=(nolabel);
vbarparm category=level response=value / group=entity groupdisplay=cluster;
run;
Hope this helps!
Dan
Along with your response and "PROC Star's" response, this works well. Thanks!!!
Transpose the data and then use SGPLOT.
data have;
infile datalines dsd dlm=',' missover;
input Entity :$10. OSAT DP LTR MLTP WADO TTIA COMM TTSE RSAT;
datalines;
National,0.82,0.71,0.69,0.5,0.88,0.82,0.81,0.78,0.87
CENTRAL,0.83,0.74,0.72,0.48,0.89,0.83,0.82,0.8,0.88
Group,0.81,0.69,0.66,0.44,0.88,0.79,0.77,0.78,0.86
Dealer1,0.88,0.76,0.73,0.37,0.89,0.81,0.8,0.81,0.9
;
run;
proc transpose data=have out=have_t ;
by Entity notsorted;
run;
proc sgpanel data=have_t;
panelby Entity / layout=columnlattice onepanel colheaderpos=bottom rows=1 novarname noborder;
vbar _name_ / group=_name_ response=Col1 stat=sum nostatlabel;
colaxis display=none ;
label col1="" _name_="";
rowaxis grid;
keylegend / position=right;
run;
This along with "SAS Super FREQ's" response, I was able to accomplish what I need, and to realize that yes, I do have to transpose the data. I was hoping to be able to graph it without having to do that. But this works!
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.