Help using Base SAS procedures

PROC PHREG interaction

Reply
Super Contributor
Posts: 372

PROC PHREG interaction

[ Edited ]

I’d like to estimate the effect of different types of chemotherapies on survival of cancer patients in considering the effect of other therapies combined with chemo, such as surgery, radiation therapies controlling to cancer stage, race/eth and age. First off, I’d like to construct table shown. How to modify the code below to come up with a table shown? I tried interaction effects with no success.

 

Table. Multivariate analysis, chemotherapy status on survival adjusting to demographics  

Variables

Chemotherapy

Dead

(N,%)

Alive (N,%)

HR (95% CI)

Surgery

Type 1

Type1

N

N

1.00 Reference

 

Type2

N

N

HR (LCL, UCL)

 

Type3

N

N

HR (LCL, UCL)

 

Type4

N

N

HR (LCL, UCL)

 

Type5

N

N

HR (LCL, UCL)

Type 2

Type1

N

N

1.00 Reference

 

Type2

N

N

HR (LCL, UCL)

 

Type3

N

N

HR (LCL, UCL)

 

Type4

N

N

HR (LCL, UCL)

 

Type5

N

N

HR (LCL, UCL)

Type 3

Type1

N

N

1.00 Reference

 

Type2

N

N

HR (LCL, UCL)

 

Type3

N

N

HR (LCL, UCL)

 

Type4

N

N

HR (LCL, UCL)

 

Type5

N

N

HR (LCL, UCL)

Type4

Type1

N

N

1.00 Reference

 

Type2

N

N

HR (LCL, UCL)

 

Type3

N

N

HR (LCL, UCL)

 

Type4

N

N

HR (LCL, UCL)

 

Type5

N

N

HR (LCL, UCL)

Radiation

Type 1

Type1

N

N

1.00 Reference

       

Type2

N

N

HR (LCL, UCL)

 

Type3

N

N

HR (LCL, UCL)

 

Type4

N

N

HR (LCL, UCL)

 

Type5

N

N

HR (LCL, UCL)

Type 2

Type1

N

N

1.00 Reference

 

Type2

N

N

HR (LCL, UCL)

 

Type3

N

N

HR (LCL, UCL)

 

Type4

N

N

HR (LCL, UCL)

 

Type5

N

N

HR (LCL, UCL)

 

/*read in sample data attached*/
proc import datafile="…\have.txt"
out=have
dbms=tab replace;
getnames=yes;
guessingrows=max;
run;
proc phreg data=have;
class
	raceth (ref='2')
	surgery (ref='5') 
	chemo (ref='5')  
	radiation (ref='2')
        stage (ref= '2');
model duration*vital_statusX(1)=chemo
	surgery radiation stage
	age_at_diagnosis raceth 
      /rl selection=stepwise slentry=0.25 slstay=0.35 details;
run;     

 

Super User
Posts: 23,770

Re: PROC PHREG interaction

You can’t get it by default, you can capture the ODS tables and customize the output via proc tabulate or report. 

There are examples on lexjansen.com and some on my github though I think it’s not quite what you want. 

Super Contributor
Posts: 372

Re: PROC PHREG interaction

Reeza please, I appreciate for some more hints. Do you have links got your github and lexjansen.com?
Super User
Posts: 23,770

Re: PROC PHREG interaction

Sorry, my GitHub one is PROC LIFETEST not PHREG, but it's here: 

https://gist.github.com/statgeek/d3bce2a9e2ef0523db9d

 

The concept is similar. 

 

1. Capture ODS tables blog post:

https://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html

2. Creating Complex Reports via Cynthia Zender

https://www.lexjansen.com/pharmasug/2008/sas/SA08.pdf

3. Specific PROC PHREG example here, with code:

https://www.lexjansen.com/nesug/nesug07/po/po22.pdf

 

I would highly suggest reading the first two but using the code from the last paper which seems pretty close to what you're looking for. It will need modifications though, which is why you need the first two papers. 

Super Contributor
Posts: 372

Re: PROC PHREG interaction

oh ouch, way beyond my SAS literacy. Hats off. But i need to dedicate good amount of time to digest all these and apply.
Super User
Posts: 23,770

Re: PROC PHREG interaction

Break it into smaller steps and each one on it's own isn't too bad. 

 

1. Capture ODS tables

2. Format using a data step

3. Proc print or report to display. 

 

The code shown has basically generalized this so it works for any process but you don't have to do that and probably shouldn't if you've never done so. Just some examples and you can run them to see how they work and if they're close enough to what you want.

 

 

Ask a Question
Discussion stats
  • 5 replies
  • 404 views
  • 6 likes
  • 2 in conversation