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

Hello - I have a dataset that looks like the below and a simple lifetest code. Why does the resulting graph show "day" on the x axis when it should be "week"?  Any easy way to fix? I'm using SAS for Academics/Studio/Learner.

 

 

Screen Shot 2022-09-20 at 8.00.01 AM.png

 

Dataset columns:

ID.  Treatment. Week. Event. Censor.

 

Code:

/*/

proc lifetest data=mukm;
time week*censor(1);
strata Treatment;
run;

/*/

 

Thank you and best wishes.

 

Anissa

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

There must be a label attached to the variable Week, change the label. 

The default label is different than day in Academics at least.

 

proc lifetest data=mukm;
time week*censor(1);
strata Treatment;
label week = 'Week';
run;

View solution in original post

3 REPLIES 3
Reeza
Super User

There must be a label attached to the variable Week, change the label. 

The default label is different than day in Academics at least.

 

proc lifetest data=mukm;
time week*censor(1);
strata Treatment;
label week = 'Week';
run;
anissak1
Obsidian | Level 7
Thank you! How do I change the label (I’m relatively inexperienced)?
Reeza
Super User
I included the code in the post.

SAS labels allow you to have user friendly names for variables in your graphs and reports.
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1r8ub0jx34xfsn1ppcjfe0u16pc.htm

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1585 views
  • 1 like
  • 2 in conversation