BookmarkSubscribeRSS Feed
Aidaan_10
Calcite | Level 5

Hi All,

                I have limited knowledge about SAS Graph/plots and I am stuck at one of the exercise's for the same. Using proc template and SGrender I have created a series and scatter plot for patient's BP over visit (for the patient with whom the selected visit is associated) and computed relative to the user defined comparator visit.

In this plot, X axis displays Visit's. Y axis display BP.

1) How do I Create this USER DEFINED comparator visit?

2) There should be an asterisk next to the name of the selected visit...I tried doing it using proc format and assigning an asterik in the format to the visit but this cant be done... as with different run the visit of interest might change..

3) I also want to apply shading to the plot as per the range's.How do I do this??

 

Any help will be greatly appreciated. THANKS

5 REPLIES 5
Reeza
Super User
Can you show some fake data and your current code? I would have assumed you could get all of this via SGPLOT instead of temples but that's a perfectly valid approach.
ballardw
Super User

And show how you attempted to format something to show an asterisk that did not work.

Aidaan_10
Calcite | Level 5

Hi Raeza,

                 Here is my sample code which I tried..


proc template;
define statgraph seriesplot ;
begingraph ;

dynamic yvar Ymin Ymax Yinc ref thk ;

layout overlay / xaxisopts=(type=discrete display=(ticks tickvalues line) )
yaxisopts=(griddisplay=on linearopts=(viewmin=Ymin viewmax=Ymax
tickvaluesequence=(start=Ymin end=Ymax increment=Yinc))) ;
layout gridded / rows=1 order=columnmajor border=false autoalign=(top);
endlayout ;
referenceline y=ref / datatransparency=.80 lineattrs=(thickness=thk) ;
seriesplot x=visit y=yvar/ group=paramcd groupdisplay=cluster clusterwidth=.5 name="seriesplot1" ;

scatterplot x=visit y=yvar / group=paramcd groupdisplay=cluster clusterwidth=.5 name="scatterplot1" ;
layout gridded / rows=1 order=columnmajor border=false autoalign=(bottom);
endlayout ;
mergedlegend "seriesplot1" "scatterplot1" ;
endlayout;
endgraph;
end ;
run;

proc sgrender data=mydata template=seriesplot;
dynamic yvar='col1' Ymin=-2 Ymax=+5 Yinc=0.5 ref=100 thk=109 ;
where col1 > . ;
run;

Aidaan_10
Calcite | Level 5
Sorry Reeza*
Reeza
Super User
Data? Can't run your code without data.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 756 views
  • 0 likes
  • 3 in conversation