06-01-2017 05:52 AM
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?
06-01-2017 07:23 AM
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?
06-01-2017 06:31 AM
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.
06-02-2017 04:21 AM
Yes, as I mention in my post, that blog has examples of all kinds of graphs with code examples. Use the search box on there to find specific things, or just scroll through and see the wonders they have come up with.