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?  

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
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.

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 597 views
  • 2 likes
  • 4 in conversation