I am using proc sgplot to get mean and SE plot.
I need to annotate so that i want to know number of subjects for each visit. this should be coming below the X-axis.
I wrote a paper a while back called "Now You Can Annotate Your Statistical Graphics Procedure Graphs" (http://support.sas.com/resources/papers/proceedings11/277-2011.pdf) that contains examples for creating output similar to your needs. The SG procedure annotation facility requires at least SAS 9.3. Let me know if you can't find an example that works for you, or if you have an questions.
Hi,
I didnt get the type of graph i find. i created a program like below but not bale to assemble the Number of subjects properly.
data anno(drop=n visit_1);
set numb;
function='text';
x1space='datavalue';
y1space='graphpercent';
label=put(n,3.);
anchor='center';
x1=_n_;
y1=input(visit_1,3.);
run;
proc sgplot data=test2 noautolegend sganno=anno pad=(bottom=12%);
highlow x=visit_1 high=high low=low / highcap=serif lowcap=serif highlabel=label;
scatter x=visit_1 y=mean / group=visit_1 groupdisplay=cluster;
refline 10/axis=X;
Yaxis values=(0 to 18 by 2) label="Dose";
Xaxis label="Number shown in the graph is Number of Subjects in that Particular Visit";
run;
include the data with your program so we can see what it does.
test2 dataset -----visit_1, mean, high ,low, label are the variables with any values
num dataset ---- visit_1 number of subjects
test2 dataset
visit_1 | mean | high | low |
1 | 2 | 12 | 0 |
2 | 3 | 12 | 7 |
3 | 4 | 13 | 5 |
4 | 5 | 13 | 2 |
5 | 1 | 13 | 1 |
6 | 6 | 154 | 1 |
7 | 2 | 12 | 3 |
8 | 3 | 11 | 5 |
9 | 4 | 16 | 6 |
10 | 5 | 13 | 7 |
numb dataset
visit_1 | number of subjects |
1 | 2 |
2 | 3 |
3 | 4 |
4 | 5 |
5 | 1 |
6 | 6 |
7 | 2 |
8 | 3 |
9 | 4 |
10 | 5 |
with my code above i was trying to display number of subjects below the X-axis
This excellent blog gives you examples on pretty much everything 9.3/9.4 SGPLOT/GTL.
You may not need the "SG annotate facility" to achieve something as simple as a table of Ns. I have done this with BLOCKPLOT statement and there is a new XAXISTABLE statement that seems even better but I have not used that.
Look at the examples in the blogs before you do anything too drastic.
XAXIS table is available for 9.4. I am using 9.3 version
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 25. Read more here about why you should contribute and what is in it for you!
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.