Hiya,
Does anyone know whether it is possible to generate a survival plot in PROC PHREG categorized by an interaction term?
Thank you!
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.
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;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.