I have a dataset with aggregated date and I would like to create a VBAR to show the distribution of the variables. I thought using the weight option would work, but it doesnt. For example, in the example below all the frequencies stand at "1", instead of using the count variable which should be somewhere between 1 and 5.
What is going on? I'm using SAS 9.3 on a windows machine.
Cheers!
proc sql;
create table class as
select distinct age, count(*) as count
from sashelp.class
group by age;
quit;
proc sgplot data=class;
vbar age / weight=count;
run;
You can also use FREQ= instead of WEIGHT= if you prefer "Frequency" over "count (Sum)" as the label of the y-axis.
proc sgplot data=class;
vbar age / freq=count;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.