BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
noye2
Calcite | Level 5

This is my last hope.

 

I am trying to set the x-axis of my survival curve from 0 to 60 months but I am having an issue executing this.

 

How can I set the x-axis max to 60 ?

 

Using SAS 9.4


proc template;
source Stat.Phreg.Graphics.Survival;
define statgraph Stat.PHReg.Graphics.Survival;
dynamic title1 title2 title3 title4 xviewMin xviewMax group groupIndex groupName plotCL plotHPD
transparency piecewise _byline_ _bytitle_ _byfootnote_;
mvar PHReg_Survival PHReg_Survival2;
BeginGraph;
if (EXISTS(PHREG_SURVIVAL))
entrytitle PHREG_SURVIVAL;
else
entrytitle TITLE1 TITLE3;
endif;
if (EXISTS(PHREG_SURVIVAL2))
entrytitle PHREG_SURVIVAL2;
else
entrytitle TITLE2 TITLE4 / textattrs=GRAPHVALUETEXT;
endif;
layout overlay / xaxisopts=(linearopts=(viewmin=XVIEWMIN viewmax=XVIEWMAX)) yaxisopts=(label=
"Survival Probability" shortlabel="Survival" linearopts=(viewmin=0 viewmax=1 tickvaluelist=(
0 .2 .4 .6 .8 1.0)));
if (PLOTCL)
bandplot LimitLower=LOWERSURVIVAL LimitUpper=UPPERSURVIVAL x=TIME / group=GROUP index=
GROUPINDEX modelname="Survival" datatransparency=transparency;
endif;
if (PLOTHPD)
bandplot LimitLower=LOWERHPDSURVIVAL LimitUpper=UPPERHPDSURVIVAL x=TIME / group=GROUP
index=GROUPINDEX modelname="Survival" datatransparency=transparency;
endif;
if (EXISTS(PIECEWISE))
seriesplot y=SURVIVAL x=TIME / group=GROUP index=GROUPINDEX name="Survival";
else
stepplot y=SURVIVAL x=TIME / group=GROUP index=GROUPINDEX name="Survival";
endif;
if (EXISTS(GROUP))
discretelegend "Survival" / location=outside title=GROUPNAME;
endif;
endlayout;
if (_BYTITLE_)
entrytitle _BYLINE_ / textattrs=GRAPHVALUETEXT;
else
if (_BYFOOTNOTE_)
entryfootnote halign=left _BYLINE_;
endif;
endif;
EndGraph;
end;
run;


ods graphics on;
/*Supplement Figure 2: Adjusted Overall Survival for Patients Starting with Local Therapy*/
%grtitle(path=Stat.Phreg.Graphics.Survival, options=display)
%let PHReg_Survival = ;

proc phreg data=combined_years_2_local_test plots(OVERLAY = BYROW) = (SURVIVAL);
class agegrp (ref='<65') sexvariable(ref='Male') race(ref='White') stage(ref='locali') registry(ref='san_fran')/param=ref;
model survival_time*death(0)=agegrp sexvariable race stage local_date_year registry/ rl;
strata local_date_year;

run;
ods graphics off;

 

 

Current graph this code is producing:

noye2_0-1713877333688.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
Did you try :
layout overlay / xaxisopts=(linearopts=(viewmin=XVIEWMIN viewmax=XVIEWMAX))
--->
layout overlay / xaxisopts=(linearopts=(viewmin=XVIEWMIN viewmax=60))

View solution in original post

1 REPLY 1
Ksharp
Super User
Did you try :
layout overlay / xaxisopts=(linearopts=(viewmin=XVIEWMIN viewmax=XVIEWMAX))
--->
layout overlay / xaxisopts=(linearopts=(viewmin=XVIEWMIN viewmax=60))

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 227 views
  • 3 likes
  • 2 in conversation