Thank you, @StatDave, for the suggestions; they were helpful. I needed to modify code as I was looking for plotting interaction effects, which had a lot of controls and a huge sample size. The code below allows plotting interaction, accommodates controls, and reduces output data for potting. proc lifereg data= mydata order=data;
model time*Died(0)= Pill|Gender control1avr control2avr control3avr /dist=weibull;
* I had a lot of controls, but they do not effect here ;
output out=out p=pred quantile=.05 control=c;
* as only 20% died in my data, I used such a small quantile;
run;
* This code can be useful for folks who deal with huge samples based on which SAS files
to build graphs due to limits in my sample, 20 million, so I needed to reduce it;
PROC SURVEYSELECT DATA=out OUT=out METHOD=SRS
SAMPSIZE=10000 SEED=1999;
samplingunit id;
RUN;
* if your sample smaller then 500k do not use it;
proc sort data=out; by Gender Pill; run;
proc sgplot;
title "Interaction effect";
label Gender="Gender";
series y=pred x=Pill/group=Gender ;
xaxis values=(0 1) label="Pill: Placebo=0 Treatment=1 ";
yaxis label=" Predicted survival time, days";
INSET ("Quantile"="=.05") / BORDER ;
run;
* try different quantiles also if you have more than one IV,
replace not engaged in interaction IVs with their average levels; Result (I use the Journal setting (Tools/Options/Preferences)
... View more