SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lmyers2
Obsidian | Level 7

Hello,

 

I'm using sas 9.4 and am trying to make a Kaplan Meier curve.  Below is my code. The error message that I get is that the variable Group is not found. However, I have the variable Group in output from a proc freq step just before running proc lifetest. It is a numeric variable 0, 1, 2 with a few missing. Why doesn't the strata step recognize my variable Group?  Does the strata variable need to be character variable or some other specification to be recognized?

 

ods graphics on;
proc lifetest data=data plots=survival (cb=hw atrisk(outside(0.15)));
   time survt * status(0);
   strata Group / order=internal test=logrank; 
run;
ods graphics off;

Best

Laura

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Did you merge the results of your PROC FREQ statement into the DATA data set?  To make sure the data set has the GROUP variable, run

 

proc contents data=data short varnum;
run;

 

and post the results.

View solution in original post

1 REPLY 1
Rick_SAS
SAS Super FREQ

Did you merge the results of your PROC FREQ statement into the DATA data set?  To make sure the data set has the GROUP variable, run

 

proc contents data=data short varnum;
run;

 

and post the results.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 1 reply
  • 1090 views
  • 0 likes
  • 2 in conversation