BookmarkSubscribeRSS Feed
Cruise
Ammonite | Level 13

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. 

 

KM_agecat.png

proc phreg.png

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;
6 REPLIES 6
Reeza
Super User

It does invalidate the assumption, but your 90+ group being much smaller is causing the issue. Can you treat age as continuous instead? 

Cruise
Ammonite | Level 13

@Reeza 

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; 

violate.png

Reeza
Super User

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
Ammonite | Level 13
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 🙂
Reeza
Super User

https://documentation.sas.com/?docsetId=statug&docsetVersion=15.1&docsetTarget=statug_phreg_examples...

 


@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 🙂

 

Cruise
Ammonite | Level 13

@Reeza 

 

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; 

violate.png

age regrouped.png

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 801 views
  • 0 likes
  • 2 in conversation