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

Hello all, 

 

I am a novice SAS user who has not used macros in the past and feel a bit in over my head at this point. Essentially I am trying to produce a KM curve for overall survival across different classes of a large cohort of cancer patients using the %newsurv macro. When I stumbled across %newsurv while trying to read up on customizing survival curves in SAS, it seemed to be hugely useful so I thought Id try it out, but I have a feeling I am oversimplifying this whole process. 

 

Thus far; 

I produced a normal KM curve using:

 

proc lifetest plot=survival(nocensor atrisk) conftype=linear ;
time survtime*vitalstatus(1);
strata nodalgroup;
run;

 

I then tried to apply %newsurv by downloading Newsurv_08012016.sas and running the program/code to call in the macro. I did this in a separate window and didn't think that changed anything but let me know if it does; 

 

Then, to apply it to my data, I used the code:

%newsurv (Data=micromets, time=survtime, cens=vitalstatus, cen_vl=1, class nodalgroup);

 

When I highlight this and click run, nothing really happens. It states "ERROR: All positional parameters must precede keyword parameters."  I know I'm falling short somewhere, but really just scratching my head trying to figure out these first few steps.

 

Any assistance with this would be greatly appreciated!

 

Thanks!

- S

 

1 ACCEPTED SOLUTION

Accepted Solutions
JeffMeyers
Barite | Level 11
Hello, That is actually my macro. If you have any questions on using it feel free to e-mail me directly (jpmeyers.spa@gmail.com). The issue is you don't have an equal sign between class and your variable name.

View solution in original post

3 REPLIES 3
JeffMeyers
Barite | Level 11
Hello, That is actually my macro. If you have any questions on using it feel free to e-mail me directly (jpmeyers.spa@gmail.com). The issue is you don't have an equal sign between class and your variable name.
sw930
Calcite | Level 5

Wow. That simple? Apparently. 

 

Jeff Meyer, I feel like I need to acknowledge you now in every manuscript I write going forward. This is an incredibly practical and helpful macro to have for clinical researchers, and I just want to thank you so much for publishing it. I feel like this will take hours off of those painful evenings I spend combining and annotating my SAS figures in photoshop. 

 

I'll be in touch if I have any other questions while I try to iron out the more extensive code over the next few days. 

 

Sincerest thanks again, 

S

 

 

JeffMeyers
Barite | Level 11
Thank you for the kind accolades. I wrote the macro for the same reasons you listed, and it has been great resource within our cancer center at Mayo Clinic. Look forward to hearing from you in the future.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1172 views
  • 7 likes
  • 2 in conversation