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;
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.
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/odsoutputanystatistic.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.
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.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.