- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I don't know if there's a way to specify two grouping variables in a single plot in that fashion easily. I think you can if you want to get into proc template or some of the more complex graphing options. I would definitely try the first option. But that also assumes I'm interpreting how you want them graphed correctly. Depending on exactly what you want, SGPANEL with PANELBY NSFASYN may be correct as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content