I have a dataset called marks and I want to use proc sgplot
to get the names of the students on the x axis and the marks of a1 on the y axis. I typed in histogram name, but apparently SAS doesn't let the x axis be non-numeric. Does anyone know if this is possible?
Asked
Active
Viewed 280 times
0

Bill Huang
- 4,491
- 2
- 13
- 31
-
Looking to the picture you shared of your data and plot, it seems that you want a bar plot, not a histogram. – LuizZ Apr 07 '21 at 05:37
1 Answers
1
In your case, it will actually just be a vertical bar chart type of graph, not a histogram. Histograms are plotted from many values per group.
So, the basic syntax will be:
title "a1 Marks by Student";
proc sgplot data=my_data;
vbar Name / response=a1mark;
run;
title;

AlexK
- 2,855
- 9
- 16
- 27