BookmarkSubscribeRSS Feed
Hello_there
Lapis Lazuli | Level 10

Hi, i'm doing a survival table for work and i'm having trouble with the syntax.

 

I'm trying to use PROC LIFETEST to produce quartiles and p values using a log rank test that is stratified by TRT (treatment) and loc (location). I'm using Kaplan-Meier estimates.

 

So far this is what i have, but it's not producing what i need. Can i receive some help?

 

ods output quartiles=a;
proc lifetest data= mydata method=pl;
 time aval*cnsr(1);
 strata trt loc / test=logrank;
run;
ods output close;

7 REPLIES 7
Ksharp
Super User
/*
Maybe your dataset have problem.
Can you post your dataset?
I test your code with SASHELP.BMT, 
and have no problem .
*/
proc lifetest data= sashelp.bmt method=pl;
 time t*status(0);
 strata group / test=logrank;
run;

Ksharp_0-1689248808382.png

 

Hello_there
Lapis Lazuli | Level 10
Thanks, i think my set up is wrong as i'm trying to output p values.
Quentin
Super User

Hi, you say:


So far this is what i have, but it's not producing what i need. Can i receive some help?

It sounds like your code is running without errors or warnings, is that correct?  Can you say more about how the results you are producing differ from the results you need?  

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
Hello_there
Lapis Lazuli | Level 10
i was trying to produce p values and output them with homtests= dsnout option. There are 4 treatment groups, with the first 3 being active, and the last one being placebo.

The output was only producing one p value, even though i needed 3 since i'm comparing each group to placebo.
Quentin
Super User

Before worrying about output datasets, I would focus on getting the output results you want.  

 

When you run the PROC LIFETEST step, do you see the p-values you want?  When I run the step on sashelp.bmt, I get one p-value for a test of equality over strata.  There are 3 groups, but I get one p-value testing overall homogeneity.  Sounds like that's not what you want.  After you figure out how to get the output results you want, it should be possible use ODS to write the results to an output dataset.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
Hello_there
Lapis Lazuli | Level 10
I think the best option would probably be to do 3 separate tests with the 4 groups, and to use a WHERE statement for the following combos:
where trt in (1,4)
where trt in (2,4)
where trt in (3, 4)
1:3 being active groups,
4 being placebo

That would produce a p value for all the pairwise comparisons against placebo.

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 Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 7 replies
  • 1379 views
  • 2 likes
  • 4 in conversation