I am about to make a graph with proc sgplot function and would like to have my table with the freq and percent values from the proc freq table inside the graph. I tried with xaxistable, but that doesn't work. Do any of you have a tip?
Thank you for your answer. I have attached a test file in excel. The code I have tried is:
proc freq data=test_EG;
proc sgplot data=test_EG;
vbar antalbarn / stat=percent statlabel datalabel;
format antalbarn barn.;
the variable "antalbarn" means how many children do a person have and the values are 0 to 2. And when I do the xaxistable it SUM and when there is 4 persons with two children the xacistable respond with 8 (=4*2) where I would like a table that respond with 4 persons has two children as in the in proc freq table.
I hope that it makes sense?
There are various ways you can do this, depends on what you want the output to look like, destination etc. I find my first port of call on any graph related topic is this excellent blog by Sanjay:
Thousands of examples of all types. Here is one example with values below the graph:
Here is one showing titles use:
You could also plot them if you want them in specific areas etc.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.