BookmarkSubscribeRSS Feed
VRD
Calcite | Level 5 VRD
Calcite | Level 5

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.

8 REPLIES 8
DanH_sas
SAS Super FREQ

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.

VRD
Calcite | Level 5 VRD
Calcite | Level 5

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;

data_null__
Jade | Level 19

include the data with your program so we can see what it does.

VRD
Calcite | Level 5 VRD
Calcite | Level 5

test2 dataset -----visit_1,  mean,  high  ,low,   label are the variables with any values

num dataset ---- visit_1 number of subjects

VRD
Calcite | Level 5 VRD
Calcite | Level 5

test2 dataset

visit_1meanhighlow
12120
23127
34135
45132
51131
661541
72123
83115
94166
105137

numb dataset

visit_1number of subjects
12
23
34
45
51
66
72
83
94
10

5

with my code above i was trying to display number of subjects below the X-axis

RW9
Diamond | Level 26 RW9
Diamond | Level 26

This excellent blog gives you examples on pretty much everything 9.3/9.4 SGPLOT/GTL.

http://blogs.sas.com/content/graphicallyspeaking/

data_null__
Jade | Level 19

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. Smiley Happy

VRD
Calcite | Level 5 VRD
Calcite | Level 5

XAXIS table is available for 9.4. I am using 9.3 version

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 4854 views
  • 0 likes
  • 4 in conversation