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

I'm trying to limit the survival estimates graph to only display data up to 72 hours.  Right now the data is displaying unto 100 hours.  My original survial time data was in seconds so I converted it to hours and altered the template to have a viewmax=72.  But this seems to give me the following error: 

 

WARNING: Insufficient data to produce 'Stat.Lifetest.Graphics.ProductLimitSurvival' Graph.

 

I don't get this error if I simply ran the code without a viewmax=72 limit.  Does anyone know what I must be doing wrong?

 

data linex; set line;
*where survival_time <='72:00:00't;
survival_timex=survival_time*0.000277778;
run;

ods path show;
proc template;
 define statgraph Stat.Lifetest.Graphics.ProductLimitSurvival; 
 
  begingraph;
   layout overlay /
    xaxisopts=(label="Survival Time (Hours)" offsetmin=.05 
	linearopts=( viewmax=80 tickvaluelist=(0 20 40 60 72)));
   endlayout;
  endgraph;
 end;
run;

ods graphics on;
ODS TRACE ON;

Proc lifetest data=linex plots=(s, lls) graphics;
	Time survival_timex*delta(0);
	Strata final_placement;
	Format final_placement treatment_assignment_.;
Run;
ods graphics off;

 proc template;
      delete Stat.Lifetest.Graphics.ProductLimitSurvival;
 run;
1 ACCEPTED SOLUTION

Accepted Solutions
einstein
Quartz | Level 8

Thank you Reeza!

 

Apparently, you need to include all the syntax in the proc template for it to work properly.

 

This link was a great resource for anyone who needs it: http://support.sas.com/kb/43/910.html 

 

Thank you SAS Community!

View solution in original post

2 REPLIES 2
Reeza
Super User

Is the only reason you're using PROC TEMPLATE to control the x axis?

You can use the macros in the documentation, have you tried playing around with those?

 

The ViewMax appears to be the right option, so I suspect the issue is somewhere else. Generally when this happens I start from scratch and change one thing at a time until it works 😉

 

 

Here's a link that goes over how to do all the changes for PROC LIFETEST:

http://blogs.sas.com/content/graphicallyspeaking/2017/06/12/customizing-kaplan-meier-plot/

einstein
Quartz | Level 8

Thank you Reeza!

 

Apparently, you need to include all the syntax in the proc template for it to work properly.

 

This link was a great resource for anyone who needs it: http://support.sas.com/kb/43/910.html 

 

Thank you SAS Community!

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
  • 2 replies
  • 4848 views
  • 0 likes
  • 2 in conversation