BookmarkSubscribeRSS Feed
sas_user4
Obsidian | Level 7

Hi all,

I am trying to plot SAS graph for survibval analysis using Proc Lifetest and Proc Gplot. However, I do not know how to change the titles of the horizontal or vertical axes! I am trying to see if the time-to-event differs by sex; my time variable=Time_Months, and censoring variable=Cat(0). The analysis is stratified by sex (Sex).

 

I am stuck trying to plot the title for the horizontal axis. Thanks for any help!

 

This is the code i am using:

 

ODS OUTPUT homtests=homT;
PROC LIFETEST DATA=sur PLOTS=S(NOCENSOR TEST) OUTSURV=LTEstimates;
TIME Time_Months*Cat(0);
STRATA Sex;
RUN;

 

title 'my data';
axis1 label='my data';

symbol1 line=1 color=blue i=stepj;
symbol2 line=2 color=red i=stepj;
proc gplot data= LTEstimates;
plot survival * Time_Months = Sex/haxis=axis1;
run;
quit;

1 REPLY 1
ballardw
Super User

Are you not getting "my data" for the label of the horizontal axis? The axis1 statement coupled with haxis=axis1 should show that.

 

Or do you mean the text of the tickmarks? "Title" is generally associated with a whole graph to describe the overall purpose, Axis Lables discribe what the individual axis measures or shows.

Tickmark values would want a FORMAT associated with the variable(s) to control text.

 

You need to provide a bit more concrete example of what you want and it might help to show the current result you are getting.

 

You'll also get suggestions to move to SGPLOT where a STEP plot with x=time_months y=survival / group=sex.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 844 views
  • 0 likes
  • 2 in conversation