Obsidian | Level 7

PROC Phreg with Contrast statement instead of hazardratio statement

Hi

I'm trying to compute hazard ratios with confidence intervals and p values for my interaction term's between my explanatory variable var and another variable, polymicrobial, that modifies the effect of var on my outcome. (interaction term significant)

var is a binary variable (1 or 2)

polymicrobial is a binary variable (1 and 0's)

I've computed HR's and CL with a  hazardratio statements as seen below. I want to compute the exact same in contrast statements, so i can get CI's and p-values for:

var = 1 vs var= 2 at polymicrobial = 1

var = 1 vs var = 2 at polymicrobial = 2

polymicrobial 1 vs 0 at var =1

polymicrobial 1 vs 0 at var=2.

my code is as follows:

Proc phreg data = d;
class var (ref='2') polymicrobial2(ref='0') /param= glm;
model (tid,Time_to_death_180Days)*Mortality_180_days(0) = var|polymicrobial age sex saps chronic_disease /risklimits ;

hazardratio var/ at(polymicrobial= all) ;
hazardratio polymicrobial / at(var=ALL) ;

run ;

Can you help me do the same with contrast statements, I don't understand the syntax.

btw im running SAS 9.4

1 ACCEPTED SOLUTION

Accepted Solutions
SAS Employee

Re: PROC Phreg with Contrast statement instead of hazardratio statement

To set up the same contrasts as the ones given on the HAZARDRATIO output, you could add the E option to the HAZARDRATIO statement.  That will give you the coefficients that are used to compute each one.  You could then use those coefficients in the CONTRAST statement.

2 REPLIES 2
SAS Employee

Re: PROC Phreg with Contrast statement instead of hazardratio statement

To set up the same contrasts as the ones given on the HAZARDRATIO output, you could add the E option to the HAZARDRATIO statement.  That will give you the coefficients that are used to compute each one.  You could then use those coefficients in the CONTRAST statement.

Obsidian | Level 7

Re: PROC Phreg with Contrast statement instead of hazardratio statement

Thank you!
Discussion stats
• 2 replies
• 1120 views
• 1 like
• 2 in conversation