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
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
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!
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.