SAS Programming

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

Hi, 

 

I am trying to get stratified and unstratified P-values and Hazard ratios. can anyone help me to identify the difference between stratified and unstratified proc lifetest code and proc phreg code in sas? 

 

Thank you in advance!

 

Adithya

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
unstratified is what you had before - ie no STRATA statement.

View solution in original post

7 REPLIES 7
Reeza
Super User

Both have STRATA statements to specify the STRATA specifically, which would allow you to easily see if the analysis was stratified or no. 

 

Is there something else you're looking for?

 


@chinna0369 wrote:

Hi, 

 

I am trying to get stratified and unstratified P-values and Hazard ratios. can anyone help me to identify the difference between stratified and unstratified proc lifetest code and proc phreg code in sas? 

 

Thank you in advance!

 

Adithya


 

chinna0369
Pyrite | Level 9

Hi Reeza, 

 

Thank you for your reply!

 

below code I am using,

 

** P-value;
ods trace on;
ods output LogUniChiSq=pval;

proc lifetest data=adtte outsurv=surv alpha=0.05;
time aval * cnsr(1);
test trtpn;
run;

ods trace off;
ods output close;

 

From the output of above code, how can I recognize the values is from stratified or unstratified? 

 

Thanks,

Reeza
Super User
You don't have a STRATA statement so you have no stratification.
Reeza
Super User

This assumes you're referring to the statistical concept of stratification which is analyzing data by strata/groups creating separate models that use the same terms. If you're not using that definition, which I'm starting to suspect then the answer will differ. Please clarify.

 

 

chinna0369
Pyrite | Level 9

Hi Reeza, 

 

I understand now and I have updated my code as below:

 

ods output HomTests=pval;

proc lifetest data=adtte outsurv=surv alpha=0.05;
time aval * cnsr(1);
strata ACCRES/group= trtpn;
run;

 

and now I am getting statified P-values based on Two-sided stratified Log-Rank test based on the stratification of ACCRES. 

 

Now how can I get p-value based on Two-sided unstratified Log-Rank test? by using above code?

 

Thank you in advance! 

 

Adithya

Reeza
Super User
unstratified is what you had before - ie no STRATA statement.
chinna0369
Pyrite | Level 9
Thank you so much!

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 7 replies
  • 5071 views
  • 0 likes
  • 2 in conversation