Josh
Josh

Reputation: 99

Make histogram in SAS from aggregated data

Is there a way to make histograms in SAS from aggregated data? By this I mean the 'Excel-way', so instead of letting sas do the aggregation the data is structured as such:

year value
2013 10
2014 15
2015 12
2016 14
2017 11
2018 12

In my experience the functions sgplot or gchart aggregate the input data or sort according to the value.

Does anyone know a solution for this?

Upvotes: 0

Views: 32

Answers (1)

PeterClemmensen
PeterClemmensen

Reputation: 4937

Use the Vbarparm Statement like this

data have;
input year value;
datalines;
2013 10 
2014 15 
2015 12 
2016 14 
2017 11 
2018 12 
;

proc sgplot data = have;
   vbarparm category = year response = value;
run;

Upvotes: 1

Related Questions