Hi there. I am stuck with trying to create a bar graph for 3 categorical variables; quintile (1-3, 4 and 5), nsfasyn(yes, no) and gradind(yes, no). My proc freq statement is as follows:
proc freq data=project;
tables gradind;
format gradind newh.;
tables quintile;
format quintile new.;
tables nsfasyn;
format nsfasyn $newn.;
tables nsfasyn*quintile*gradind/ plots=freqplot (twoway=cluster scale=percent) out=graphs5;
run;
From this code I got the following graphs:
How do I combine these graphs into one bar graph? I was thinking of using proc sgplot but nothing has work so far as it only allows for 2 variables.
Please describe HOW want this combined into one graph. Do you want 4 groups of 3 bars side by side in one panel?
Stacked on top of each other? One set of values "behind" the other?
If you have an image of what you want that gives us a chance.
You will almost certainly have to use something other than Proc FREQ as that procedure has very few graphing control options and is more intended for data exploration than "camera ready" for report purposes.
It would be 4 groups(2 x dropout, 2 x graduates) with 3 bars (quintiles) for each of the groups. So it be be one whole graph with (1 x dropout, 1 x graduate and 3 bars for each) for nsfasyn=y and then (1 x dropout, 1 x graduate and 3 bars for each) for nsfasyn=n. So it basically combine the 2 graphs I posted all in one. I am stuck here
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: