BookmarkSubscribeRSS Feed
sam1231
Obsidian | Level 7

Hi,

 

In my graph i am trying to show data until 3 year but when i added extra time point data was truncated. its not showing on x axis.

proc sgplot data=kmout;
  step x=time y=surv / group=grp lineattrs=(pattern=solid) name='s';
  scatter x=citime y=surv / markerattrs=(symbol=plus) yerrorupper=yup yerrorlower=ylow name='c' group=grp;

yaxis values=(0 to 40 by 5) label="&ydesc" ;



xaxis values=(0,30,183,365,730,1095) Label='Days Post-Procedure';
  xaxistable atrisk / x=citime class=grp
location=outside colorgroup=grp
title='Number of subjects at risk' separator;

run;
2 REPLIES 2
ballardw
Super User

@sam1231 wrote:

Hi,

 

In my graph i am trying to show data until 3 year but when i added extra time point data was truncated. its not showing on x axis.

proc sgplot data=kmout;
  step x=time y=surv / group=grp lineattrs=(pattern=solid) name='s';
  scatter x=citime y=surv / markerattrs=(symbol=plus) yerrorupper=yup yerrorlower=ylow name='c' group=grp;

yaxis values=(0 to 40 by 5) label="&ydesc" ;



xaxis values=(0,30,183,365,730,1095) Label='Days Post-Procedure';
  xaxistable atrisk / x=citime class=grp
location=outside colorgroup=grp
title='Number of subjects at risk' separator;

run;

If a value you want to graph involves dates then it is almost certain you will be better off creating actual SAS date values as there are a large number of tools that will work with them. For instance some years have more than 365 days and then your cutting data at 1095 days duration might be removing some.

 

Since other values on your x-axis such as 30 and 365 are also not appearing I am not sure that the graph you have in your attachment was built with the code that you show. It does not help diagnosis of code issues to cut up the results. If your data is so sensitive that you cannot show the entire graph, then create dummy data that shows the same issue, post the data as well as the code.

 

It might be a good idea to post the LOG of the code that creates the output in the attachment.

sam1231
Obsidian | Level 7

thanks

SAS Innovate 2025: Call for Content

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!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1297 views
  • 0 likes
  • 2 in conversation