Hi Folks:
I'm conducting survival analyses and agecat: one of categorical variables crossed on the KM survival curves. Does it invalidate the assumption of proportional hazard and stop me for a Cox proportional HM? two other categorical variables: sex and comorb (1,0) don't have this issue.
Thank you for your time and help.
proc sort data=pti4;
by sex agecat comorb; run;
proc phreg data=pti4;
class sex1(ref='1') agecat(ref='2') comorb(ref='0')/param=ref order=internal;
model duration*vital_status(0)= sex1 agecat comorb/ties=Efron;
run;
It does invalidate the assumption, but your 90+ group being much smaller is causing the issue. Can you treat age as continuous instead?
the age variable is categorical to begin with such as: 0, 10s, 20s, 30s, 40s, 50s, 60s, 70s, 80s, 90s and 10s. I have no events until 30s and very few events in some age groups. See attached. In the snippet, how agecat is created from 10-year age group.
if age1=. then agecat=.;
if age1 in (0,1,2) then agecat=1; else
if age1 in (3,4) then agecat=2; else
if age1 in (5,6) then agecat=3; else
if age1 in (7,8) then agecat=4;
if age1 in (9,10) then agecat=5;
It seems like that's an arbitrary decision then. In that case I'd like recommend using 80+ instead of 90+ and I suspect that will help. Depending on what you're measuring the other usual suggestion is to make it a time dependent covariate, which sort of makes sense for age since it does not stay the same over time anyways.
@Cruise wrote:
how do you make age a time dependent variable? my date variable in the data is 'date' by day unit, so: age(10-year group)*date as an interaction? or use the agecat*date?
Bear with me please, if my wild guess doesn't make sense 🙂
Regrouping age as below solved the crossing in the age-groups in KM curves.
if age1=. then agec=.;
if age1 in (0,1,2) then agec=1; else
if age1 in (3,4) then agec=2; else
if age1 in (5,6) then agec=3; else
if age1 in (7,8,9,10) then agec=4;
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.