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;
A bit old but possibly useful.
https://gist.github.com/statgeek/d3bce2a9e2ef0523db9d
Something else that may be useful:
/*
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;
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?
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.
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!
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.
Ready to level-up your skills? Choose your own adventure.