BookmarkSubscribeRSS Feed
cogi
Calcite | Level 5
Hi,

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

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

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
2 REPLIES 2
Doc_Duke
Rhodochrosite | Level 12
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.
cogi
Calcite | Level 5
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!) ....how can I prefix the word with non-printable characters ?

thanks for you help

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1577 views
  • 0 likes
  • 2 in conversation