Help using Base SAS procedures

proc lifetest, strata

New Contributor
Posts: 2

proc lifetest, strata


I have following format for the variable stadium:
value stage 1 = "early"
2 = "intermediate"
3 = "advanced";
data comparison;
set comparison;
format stadium stage.;

and when I run the lifetest procedure:
proc lifetest data=comparison method=km alpha=0.05 ;
time sv*tod_yn(0);
strata stadium;

when I am using this code, I have folloing stratum
stratum 1 : stadium=advanced
stratum 2 : stadium=early
stratum 3 : stadium=intermediate
(it is ordered alphabetisch)

I would like to have following:
stratum 1 : stadium=early
stratum 2 : stadium=intermediate
stratum 3 : stadium=advanced
(ordered after the values of the variable stadium 1,2,3).

can you please tell me what I should do to get the stratum I would like to have.

Thank you so much for you help
Trusted Advisor
Posts: 2,113

Re: proc lifetest, strata

the simple way is to change the format to "1: Early", etc. If you don't want it to show in the printout, you could prefix the word with non-printable characters to effect the sort order.
New Contributor
Posts: 2

Re: proc lifetest, strata

thank you so much for your answer,

but I do not want to habe "1: early"...etc ( I already try this way, but it is not what I want, because I use it too to graph!) can I prefix the word with non-printable characters ?

thanks for you help
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation