Can I add the frequency for each group (MAKE) in the below plot? I can generate the plot to check the distribution by MAKE, but I would like to display the exact number of observations (for each MAKE).
ods graphics/height=800px;
proc sgplot data=sashelp.cars;
hbar make;
yaxis display=all fitpolicy=none;
run;
Small correction:
ods graphics/height=800px;
proc sgplot data=sashelp.cars;
hbar make / datalabel;
yaxis display=all fitpolicy=none;
run;
Sorry for the bad display of the code. The below is the same as in the main posting.
ods graphics/height=800px;
proc sgplot data=sashelp.cars;
hbar make;
yaxis display=all fitpolicy=none;
run;
Small correction:
ods graphics/height=800px;
proc sgplot data=sashelp.cars;
hbar make / datalabel;
yaxis display=all fitpolicy=none;
run;
Again, your suggestion worked well for the example I posted.
Then I applied it to my own dataset and SAS tells me the below warning:
WARNING: The data labels are suppressed. Use DATALABELFITPOLICY=NONE to force the labels to be displayed.
When I added DATALABELFITPOLICY=NONE in my code, it works well. Do you know why this option is needed only for some cases?
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 16. 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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: