Hi all.
I created a boxplot using SGPLOT:
proc sgplot data=Sample;
vbox CDRSUM / connect=median category=NACCFDYSYear group=cases_A__control_B;
run;
I want to add the number of available observations for each year to the bars.
Does anyone know how to do this?
Thanks
What do you mean by 'available observations'?
Where should the number appear? Inside the bar? The number will be pretty small.
It is always a good idea to discuss items in terms of the VARIABLE names. We really do not know anything that tells us "observations for each year" or which variable actually is a year.
I guess you may be asking about the number of observations for NACCFDYSYear.
Also, where you want it the values to appear can make a big difference in approach.
If placing the value near the Xaxis is appropriate then perhaps:
xaxistable NACCFDYSYear /stat=freq;
Thanks for helping me. I tried xaxistable and recieved the following:
WARNING: The AXISTABLE supports only SUM and MEAN statistics when a bar
chart, line chart, or dot plot is not used. The SUM statistic will
be used by default.
So freq cannot be used with a box plot
The AXISTABLE cannot give frequencies for a box plot. Any other suggestions? Thanks
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.