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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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