BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Christina96
Calcite | Level 5

Hi! I am doing stratified cox proportional hazard regression analyses. I used by statement with proc sort stated ahead.

My colleague told me to use strata statement. And I tried but I did not get stratum-specific results. Instead, I only got one HR (assuming there were 3 strata). I wondered how to do this with strata statement. Or, I should stick with the by statement with proc sort.

 

Thank you in advance!

 

Here's the code:

proc phreg data=mydata namelen=32;
class A(ref="1") B(ref="0") C(ref="aa");
model personyrs*Y(0)=X
					 A B C/rl;      
strata D;
hazardratio X;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
OsoGris
SAS Employee
You do not get stratum specific estimates using the STRATA statement in PROC PHREG. PHREG multiplies the partial likelihoods from each strata and then optimizes (determines the coefficients) from the resulting product. It sounds like maybe you want to use a BY statement instead to get estimates specific to a particular group or groups.

View solution in original post

4 REPLIES 4
OsoGris
SAS Employee
You do not get stratum specific estimates using the STRATA statement in PROC PHREG. PHREG multiplies the partial likelihoods from each strata and then optimizes (determines the coefficients) from the resulting product. It sounds like maybe you want to use a BY statement instead to get estimates specific to a particular group or groups.
Christina96
Calcite | Level 5

Thank you very much! Others also suggested that WHERE statement would work. I wondered if there's any difference. Based on my understanding, I can get three stratum-specific estimates by running PHREG once. But for WHERE, I need to run it 3 times if I have 3 strata. Please correct me if I am wrong. I did not find any detail explanation about WHERE statement under PHREG in SAS help center.

 

Thank you!

OsoGris
SAS Employee
I don't think you want a WHERE statement which would mean you would have to run PHREG 3 times to get 3 sets of estimates. Whereas a BY statement can handle this with one run of PHREG.
Christina96
Calcite | Level 5

Thank you very much! I also think BY would be the best fit but I was not sure about it. And, thanks for the explanation on the STRATA statement in PHREG. 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 728 views
  • 0 likes
  • 2 in conversation