SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
smackerz1988
Pyrite | Level 9

I have this section of a table which compares 2 drugs

smackerz1988_0-1698232232899.png

and this piece of of code (AvalM is Aval transformed to months using this code avalM = aval / 365.25 * 12;)

ods results off;
ods output CensoredSummary=stat00 Quartiles=med00 homtests= logrank00;
PROC LIFETEST data = adtte00 METHOD = km CONFTYPE=LOGLOG plots=survival(atrisk=3 6 9 12 18 24) ;
TIME avalM * CNSR(1) ;
STRATA trtp;
by &Subgrp;
RUN;
ods results on;

Now I know there is an option in PROC LIFETEST for plots such as 

 

plots=survival(atrisk= 0 to 2500 by 500)

Can something similar be done here just to get the results for each month specified and can the by statement be adjusted as the pattern is 3,6,9,12,18,24 so the first 4 are every 3 months but the rest are every 6 months. Any help would be greatly appreciated. 

data have;
input  SUBJID $ AVALM 8. CNSR; 
infile datalines dlm = '|';
datalines;
1001|0.0328542094|0
1002|4.205338809 |1
1003|0.0328542094|0
;
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
/*
That warning said you need OPEN " ODS graphics " by ods graphics; 
And use ODS OUTPUT to save this graph into a dataset.
*/

ods graphics; 
ods output  SurvivalPlot= SurvivalPlot;  /* <-- Here is */
PROC LIFETEST data = sashelp.bmt  METHOD = km CONFTYPE=LOGLOG  plots=survival(atrisk= 0 to 2500 by 500);
	TIME t * Status(0) ;
	STRATA Group;
RUN;

Ksharp_0-1698320163191.png

 

View solution in original post

3 REPLIES 3
Ksharp
Super User

Can not list these months in PLOT ?

 

PROC LIFETEST data = adtte00  METHOD = km CONFTYPE=LOGLOG  plots=survival(atrisk=3 6 9 12 18 24) ;
	TIME t * Status(0) ;
	STRATA Group;
	RUN;
smackerz1988
Pyrite | Level 9

@Ksharp I get the warning and log notes below. Is there a way to just get the results in a data set as opposed to using ODS graphics or would this require additional steps? 

 

"WARNING: ODS graphics must be enabled to obtain the full features of the PLOTS= option.

NOTE: 28503 bytes written to
/saswork/SAS_work8ED3000050D2_dsprgn05.ds-grid.com/SAS_workE693000050D2_dsprgn05.ds-grid.com/lifetest1.png.
NOTE: PROCEDURE LIFETEST used (Total process time):
real time 0.79 seconds
cpu time 0.74 seconds

NOTE: The above message was for the following BY group:
Full Analysis Set Population Flag=Y"

Ksharp
Super User
/*
That warning said you need OPEN " ODS graphics " by ods graphics; 
And use ODS OUTPUT to save this graph into a dataset.
*/

ods graphics; 
ods output  SurvivalPlot= SurvivalPlot;  /* <-- Here is */
PROC LIFETEST data = sashelp.bmt  METHOD = km CONFTYPE=LOGLOG  plots=survival(atrisk= 0 to 2500 by 500);
	TIME t * Status(0) ;
	STRATA Group;
RUN;

Ksharp_0-1698320163191.png

 

sas-innovate-white.png

Join us for our biggest event of the year!

Four days of inspiring keynotes, product reveals, hands-on learning opportunities, deep-dive demos, and peer-led breakouts. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 2273 views
  • 0 likes
  • 2 in conversation