BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Leo9
Quartz | Level 8

I am trying to plot a high low bar in SAS using proc sgplot procedure. The sample data and code is below. No matter I do, I do not see the FilledArrow when the end day is missing. In fact sas is not even plotting these subjects. When Start and End both are present it is working fine but not when start is present but end is missing. In that case these subjects are not plotted and I do not see FilledArrow.  Any help is appreciated.

 

Sample Data

Subject   Start   End    ACAP              Project

1010        1         25                                A

1002        1        75                                 A

1003        1        .         FilledArrow         A

2001        1        56                                  B

2002         1       .         FilledArrow           B

...

 

proc sgplot data=final noautolegend nocycleattrs;

highlow y=subject low=start high=end / highcap=acap group=project type=bar nooutline nomissinggroup lowlabel = subject transparency=0.3 ;

xaxis label='Days' valueshint;

yaxis reverse display=(noticks novalues noline) label='Subjects Received Study Drug' min=1;

run;

1 ACCEPTED SOLUTION

Accepted Solutions
djrisks
Barite | Level 11

Hello Leo,

 

I believe that you should still impute end values for subject 1003 and 2002. You could impute the value of 75, or choose a smaller or larger value, depending on how you want to represent missing values.

 

Please see an example below:

 

data final2;
  set final;
  if end = . then end = 75;
run;


proc sgplot data=final2 noautolegend nocycleattrs;
  highlow y=subject low=start high=end / highcap=acap group=project type=bar nooutline nomissinggroup lowlabel = subject transparency=0.3 ;
  xaxis label='Days' valueshint;
  yaxis type = discrete reverse display=(noticks novalues noline) label='Subjects Received Study Drug' min=1;
run;

HighLow.gif

View solution in original post

1 REPLY 1
djrisks
Barite | Level 11

Hello Leo,

 

I believe that you should still impute end values for subject 1003 and 2002. You could impute the value of 75, or choose a smaller or larger value, depending on how you want to represent missing values.

 

Please see an example below:

 

data final2;
  set final;
  if end = . then end = 75;
run;


proc sgplot data=final2 noautolegend nocycleattrs;
  highlow y=subject low=start high=end / highcap=acap group=project type=bar nooutline nomissinggroup lowlabel = subject transparency=0.3 ;
  xaxis label='Days' valueshint;
  yaxis type = discrete reverse display=(noticks novalues noline) label='Subjects Received Study Drug' min=1;
run;

HighLow.gif

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 444 views
  • 0 likes
  • 2 in conversation