BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Cruise
Ammonite | Level 13

Hi SAS experts,

 

I'm conducting survival analysis where drugs that patients received are categorized to broad groups of biologic, chemo, hormonal, immuno and antibiotic (trt_other) in various combinations. My adjusted model produced Hazard Ratios for each treatment categories as shown in image below. However, I'm more interested in interactions of these five categorical treatments since treatments mostly had been prescribed in combinations. Contrast supposed to be used?

 

Any comments, hints or direct helps?

 

Thank you so much for your time!

 

phreg.png

 

 

data model;
input id duration vital_status1	trt_bio	trt_chemo trt_hormone trt_immuno trt_other;
cards;
1	701	0	0	1	1	1	1
2	2123	1	1	1	0	0	0
3	2330	0	0	0	1	0	0
4	2513	1	0	1	0	0	0
5	57	0	0	1	0	0	0
6	1170	1	0	1	1	0	0
7	4032	1	1	1	0	1	0
8	2302	1	0	0	1	0	0
9	1230	0	0	1	0	1	0
10	1876	0	0	1	0	0	0
11	1503	0	0	1	1	0	0
12	2886	1	1	1	0	0	0
13	3941	1	0	0	1	0	0
14	584	0	0	1	0	0	0
15	1812	1	0	1	0	1	0
16	1025	0	0	1	1	0	1
17	3759	1	0	1	0	0	0
18	995	0	0	1	0	0	0
19	1297	1	1	1	0	0	0
20	770	0	0	1	0	0	1
21	263	0	0	1	1	0	1
22	472	1	0	1	0	1	0
23	490	1	0	1	1	0	0
24	1322	1	0	1	0	0	0
25	1940	0	0	1	0	0	0
26	103	0	0	1	0	0	0
27	887	0	0	1	1	0	0
28	2827	1	0	1	0	0	1
29	2251	1	1	0	0	0	1
30	3537	1	0	1	0	0	0
31	513	0	0	1	0	0	0
32	336	0	0	1	1	0	0
33	1402	0	0	1	0	0	0
34	2974	1	0	0	1	1	0
35	4248	1	1	1	0	0	1
36	3166	1	0	1	0	0	0
37	2053	1	0	1	0	0	0
38	2126	1	0	0	1	0	0
39	2236	0	0	1	0	0	0
40	898	1	0	1	0	0	0
41	645	0	0	1	0	0	0
42	113	0	1	0	1	0	0
;

proc phreg data=model; 
class trt_bio(ref='1') trt_chemo(ref='1') 
      trt_hormone(ref='1') trt_immuno(ref='1') 
      trt_other(ref='1') /param=ref order=internal;
model duration*vital_status1(1)= trt_bio trt_chemo trt_hormone trt_immuno
      trt_other/ties=Efron rl;
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
quickbluefish
Barite | Level 11

I don't think you need the CLASS statement at all here since you're working with binary variables.  Don't you actually want zero as the reference for these?  About the interactions, there are all sorts of handy shortcuts.  For instance, if you have 4 variables (A, B, C, D) and you want all two-way interactions between them (plus the main effects, as usual), you can simply do this in the MODEL statement:

 

MODEL time * event(0) = A | B | C | D @2 ;

 

Where @2 indicates all two-way interactions, i.e. 

A*B A*C A*D B*C B*D C*D 

plus the main effects

A B C D

 

All described much better here (for GLM, but you can do the same in PHREG):

https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glm_sect027...

 

 

View solution in original post

1 REPLY 1
quickbluefish
Barite | Level 11

I don't think you need the CLASS statement at all here since you're working with binary variables.  Don't you actually want zero as the reference for these?  About the interactions, there are all sorts of handy shortcuts.  For instance, if you have 4 variables (A, B, C, D) and you want all two-way interactions between them (plus the main effects, as usual), you can simply do this in the MODEL statement:

 

MODEL time * event(0) = A | B | C | D @2 ;

 

Where @2 indicates all two-way interactions, i.e. 

A*B A*C A*D B*C B*D C*D 

plus the main effects

A B C D

 

All described much better here (for GLM, but you can do the same in PHREG):

https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glm_sect027...

 

 

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

What is ANOVA?

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.

Discussion stats
  • 1 reply
  • 1574 views
  • 1 like
  • 2 in conversation