Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
sas_user_0510
Calcite | Level 5

Hiya,

 

Does anyone know whether it is possible to generate a survival plot in PROC PHREG categorized by an interaction term?

 

Thank you!

2 REPLIES 2
ballardw
Super User

Could post the code you are using for your model? And include a brief description of your data, which variables are categorical and how many levels and which are continuous. And describe what sort of plot you are contemplating since Phreg can create more than one type.

 

Without details this is very much a "maybe, it depends". An interaction term that involves a continuous variable for example is likely to take a bit more work to create categories.

Very likely it may require creating output data sets, some massaging and use of another procedure such as Sgplot to create the actual graphs.

sas_user_0510
Calcite | Level 5

Thank you! So the data has subjects that are were in 1 of 2 treatments and were offered 1 of 2 reward types (2x2 design). Both variables are nominal categorical. Please see my code below, I am using the overlayed survival plot, currently defined by SURVIVAL=_ALL_/DIRADJ GROUP=TREATMENT, but really I need the group to be TREATMENT*REWARD so that I get four lines, each representing the four categories of treatment*reward? Thanks in advance for your help! 

 

PROC PHREG DATA=DATA PLOTS (OVERLAY)=SURVIVAL;
CLASS TREATMENT REWARD;
MODEL IS*IPF(0) = TREATMENT REWARD TREATMENT*REWARD BW / RISKLIMITS TIES=EFRON MAXITER=100;
BASELINE OUT=REWSOCISBASELINE COVARIATES=TMAZE.REWARDSOCIAL OUTDIFF=REWARDSOCIALISOUTDIFF LOGLOGS=REWARDSSOCIALISLLS SURVIVAL=_ALL_/DIRADJ GROUP=TREATMENT;
OUTPUT OUT=REWARDSOCIALISOUTPUT XBETA=REWARDSOCIALISXBETA STDXBETA=REWARDSOCIALISSTDERROR RESMART=REWARDSOCIALISMARTINGALERES RESDEV=REWARDSOCIALISDEVIANCERES RESSCH=REWARDSOCIALISSCHOENFELDIHE REWARDSOCIALISSCHOENFELDIHS REWARDSOCIALISSCHOENFELDPHE REWARDSOCIALISSCHOENFELDPHS DFBETA=REWARDSOCIALISDFBETA;
HAZARDRATIO TREATMENT;
HAZARDRATIO REWARD;
HAZARDRATIO BW;
ASSESS PH/RESAMPLE;
RUN; 

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 2 replies
  • 625 views
  • 0 likes
  • 2 in conversation