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?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.