BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
_MooMoo
Obsidian | Level 7

Hello SAS communities!

 

I am currently working on a project and encountered some issues so I am posting these questions!

 

1. Suppose, we are submitting following codes in PROC PHREG: time*event(0)=main_effect sex, where sex is a binary variable. We are trying to output hazard ratio of the main effect by each level of the categorical variable. When I include HAZARDRATIO option within PROC PHREG procedure, it returns the hazard ratio that shows how different male is from female. Instead, I subset the data set by sex. One data set with only male and another data set with only female. And run PROC PHREG each of the data sets and output hazard ratio of the main effect; we will have one hazard ratio of the male population and another hazards ratio of the female population. Is this a valid approach?

 

2. Is there any option within PROC PHREG procedure will output the hazard ratios I need from above question? For example, LSMEANS does the job in PROC MIXED, LOGISTICS, and other procedures.

 

Thanks in advance and let me know if anything is unclear!

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Essentially, you are asking about the difference between BY-group processing to analyze separate groups of data versus using the CLASS statement (and including the CLASS variable in the model) to compare across groups. I have an extensive discussion with examples in the article "The difference between CLASS statements and BY statements in SAS."

 

If your intention is to compare survival between sexes, you should include SEX in the model.

 

To address your questions: 

1. When you include SEX in the model, you can compare the survival between males/females. If you use BY SEX, then the predicted values for the regression should be the same, but you have no way to compare the relative risks, odds ratios, etc.

2. I'm not sure what you are asking here. The PHREG procedure supports the ESTIMATE and CONTRAST statements. 

View solution in original post

2 REPLIES 2
Rick_SAS
SAS Super FREQ

Essentially, you are asking about the difference between BY-group processing to analyze separate groups of data versus using the CLASS statement (and including the CLASS variable in the model) to compare across groups. I have an extensive discussion with examples in the article "The difference between CLASS statements and BY statements in SAS."

 

If your intention is to compare survival between sexes, you should include SEX in the model.

 

To address your questions: 

1. When you include SEX in the model, you can compare the survival between males/females. If you use BY SEX, then the predicted values for the regression should be the same, but you have no way to compare the relative risks, odds ratios, etc.

2. I'm not sure what you are asking here. The PHREG procedure supports the ESTIMATE and CONTRAST statements. 

_MooMoo
Obsidian | Level 7

Thank you very much for your answer!

 

What I was asking was stratified analysis (I was not clear!).

This can be achieved by using WHERE statement in PROC SURVEYREG.

 

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