Data visualization with SAS programming

Limiting the X-axis Range in Proc Lifetest

Accepted Solution Solved
Reply
Contributor
Posts: 70
Accepted Solution

Limiting the X-axis Range in Proc Lifetest

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;

Accepted Solutions
Solution
‎08-16-2017 10:39 AM
Contributor
Posts: 70

Re: Limiting the X-axis Range in Proc Lifetest

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


All Replies
Super User
Posts: 19,058

Re: Limiting the X-axis Range in Proc Lifetest

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 Smiley Wink

 

 

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/

Solution
‎08-16-2017 10:39 AM
Contributor
Posts: 70

Re: Limiting the X-axis Range in Proc Lifetest

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!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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