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

HI,

I AM GENERATING KAPLAN MEIER CURVE IN SAS.

1. I WANT X-AXIS TO SHOW 0 TO 180, BY INTERVALS OF 30.

2. I WANT Y-AXIS TO BE FLIPPED; INSTEAD OF 0 TO 1, I WANT IT TO SHOW 1 TO 0 (TO HAVE THE CURVE FLIPPED). HOW DO I DO THIS IN THE BELOW PROC LIFETEST CODE? I TRIED YOPTIONS, XOPTIONS, PLOT OPTION, BUT NOTHING SEEM TO WORK.

 

PROC LIFETEST DATA=combo_by_state;
TIME SURVT*EVENT(0);
STRATA STATE;
WHERE PANDEMIC=1;
RUN;

1 ACCEPTED SOLUTION

Accepted Solutions
OsoGris
SAS Employee
I think you want a "Failure plot" where Failure = 1 - Survival. Your code didn't show any plots option but you can use syntax like PLOTS=S(FAILURE) to get a failure plot that is the reverse of a survival plot.

View solution in original post

5 REPLIES 5
OsoGris
SAS Employee
I think you want a "Failure plot" where Failure = 1 - Survival. Your code didn't show any plots option but you can use syntax like PLOTS=S(FAILURE) to get a failure plot that is the reverse of a survival plot.
suhana1211
Calcite | Level 5
This is the solution to by question #2 - thank you!!
Reeza
Super User

For X Axis specify a timelist in the PROC LIFETEST 

 

 

proc lifetest data=combo_by_state timelist=(0 to 180 by 30);

 


@suhana1211 wrote:

HI,

I AM GENERATING KAPLAN MEIER CURVE IN SAS.

1. I WANT X-AXIS TO SHOW 0 TO 180, BY INTERVALS OF 30.

2. I WANT Y-AXIS TO BE FLIPPED; INSTEAD OF 0 TO 1, I WANT IT TO SHOW 1 TO 0 (TO HAVE THE CURVE FLIPPED). HOW DO I DO THIS IN THE BELOW PROC LIFETEST CODE? I TRIED YOPTIONS, XOPTIONS, PLOT OPTION, BUT NOTHING SEEM TO WORK.

 

PROC LIFETEST DATA=combo_by_state;
TIME SURVT*EVENT(0);
STRATA STATE;
WHERE PANDEMIC=1;
RUN;




suhana1211
Calcite | Level 5
I tried that - didn't work. My x-axis still showing 0 to 180 by intervals of 50 (I want intervals of 30).
suhana1211
Calcite | Level 5
I tried that - didn't work. My x-axis still showing 0 to 180 by intervals of 50 (I want intervals of 30).

PROC LIFETEST DATA=combo_by_state
PLOTS=S(FAILURE)
TIMELIST=(0 TO 180 BY 30);
TIME SURVT*EVENT(0);
STRATA STATE;
WHERE PANDEMIC=1;
RUN;

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
  • 5 replies
  • 2278 views
  • 0 likes
  • 3 in conversation