BookmarkSubscribeRSS Feed
Sally_Caffrey
Obsidian | Level 7

Hi, I have a data including trt variable and resp variable, below is the unique value. 

 

proc sql;select distinct trt, resp from data;run;

 

Sally_Caffrey_1-1686580936366.png

Then I use this data to create survival data by proc lifetest, but the "survival" data from the ods output has a trt group that does not exist in the data, which looks very odd...

 

proc lifetest data=data timelist=(0 to 12 by 1) atrisk outsurv=surviv ;  
by trt  ;
time aval*cnsr(1);
strata resp  ;
ods output SurvivalPlot=survival ProductLimitEstimates=atrisk Quartiles=Quartiles;
run;

proc sql;select distinct trt, Stratum, StratumNum from survival;run;

Sally_Caffrey_2-1686581712266.png

For trt=2, the resp changes to "PR(N=70)" instead of "PR(N=5)". It follows the trt=1...

Does anyone knows why this wrong Stratum is output ? How to fix it ?

 

2 REPLIES 2
Reeza
Super User
You'll need to post your actual code and log for us to help out here. 99.9% of times this is user error, for example using different dat sets as input.
ballardw
Super User

Show every bit of code that you ran between that Proc SQL (which would still be running for quite a while as

SQL should terminate with QUIT; instead of RUN;) and that Proc Lifetest.

 

On possibility is if you are in the habit of using code like the following then you may have had a logic error changing values.

data data;
   set data;
/* manipulation goes here*/
run;

 

 

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

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