I am having trouble making a side by side verticle bar graph and I am wondering if my data are sorted poorly.
My data are in the attached files which have not been working out.
I would like the figure to look like the attachment titled "capture"
Hi:
What code are you using? SAS/GRAPH and PROC GCHART or ODS GRAPHICS and PROC SGPLOT or???
What is your destination of interest? HTML, RTF, PDF?
cynthia
The code I have been using with no luck is very similar to sanjay's response.
data y72 y13; set nototals
year=72; totalseed=Dc1_1972; output y72;
year13; totalseed=Dc1_2013, ouput y13;
run;
proc sgplot;
vbar year / group=year groupdisplay=cluster response=totalseed;
run;
this just gets the one group (Dc1) garphed when I want DC1, DC2 and DC3 all on the same graph
S
First - You are using the same variable (year) for both category and group. There is no distinct GROUP variable. Second, the graph will depend on your data. You need a column with DC1, DC2, etc. as values in the column, and this column should be provided as the GROUP role in the statement.
A smaller sample data with just what you need would be easier to work with. If you have SAS 9.3 or higher, you can use the following SGPLOT example. Substitute the appropriate data set, category, group and response variables. "Cluster" is a keyword you must use.
proc sgplot data=sashelp.cars;
vbar origin/ response=mpg_city group=type groupdisplay=cluster;
run;
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!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.