Hi,
I am performing univariate analyses on categorical and continuous variables such that I have hazard ratios with 95% confidence interval and p-values for the treatment and control arm.
When categorising my continuous variable, Hb - the output did not make sense (i.e. higher haemoglobin associated with worst survival compared to anemia). I realised that I was using PROC PHREG and by statement - so it would split the group to treatment and control then run the HR and both HR is not comparable. Looking instead to perform HR then divide into control/treatment.
E.g. Instead of:
proc phreg data=dataset;
model ttpfsmo*pfs(0)=Hb_ten/risklimits ties=efron;
by randtrt;
run;
Should I be doing:
proc phreg data=solo2_date (where = (randtrt = 0));
model ttpfsmo*pfs(0)=Hb_ten/risklimits ties=efron;
run;
proc phreg data=solo2_date (where = (randtrt = 1));
model ttpfsmo*pfs(0)=Hb_ten/risklimits ties=efron;
run;
What is the difference using BY and WHERE?
Or should I be using PROC PHREG statement but this time with contrast statement:
proc phreg data=dataset;
class hb_level randtrt / param = ref ref = first;
model ttpfs*pfs(0) = hb_level|randtrt / risklimits ties=efron;
contrast '0' randtrt 1 /estimate = exp;
contrast '1' randtrt 1 randtrt*hb_level 1 0 /estimate = exp;
run;
When I use the last code (output attached), with the last table - Is the estimate the hazard ratio? How do I tell what is treatment and what is control group?