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.
Thanks in advance
btw im running SAS 9.4
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.
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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.