Help using Base SAS procedures

Trouble with the %CIF macro

Reply
Occasional Contributor
Posts: 6

Trouble with the %CIF macro

Hi everyone,

 

I'm having a bit trouble with the %CIF macro. I can't change the title even though I'm doing it correct (I think).

 

This statement works fine:
%CIF (DATA=final, TIME=follow_up, STATUS=hypertension, EVENT=1, censored=0, GROUP=case);

 

When adding TITLE=xxxx, the title won't change, although the cumulative incidence figure looks like the above:

%CIF (DATA=final, TIME=follow_up, STATUS=hypertension, EVENT=1, censored=0, GROUP=case, TITLE=xxxx);

 

Hope, you guys can help!

 

 

Super User
Super User
Posts: 6,500

Re: Trouble with the %CIF macro

I think that the TITLE= parameter only applies to a limited part of the output.

TITLE=value
    specifies the first title for the cumulative incidence function plot. Do not use quotation marks.

TITLE2=value
    specifies the second title for the cumulative incidence function plot. Do not use quotation marks.

 

 

But even for that it looks like the TITLE statements are using single quotes instead of double quotes.  You should report to SAS.

title '&title';
title2 '&title2';

 

Occasional Contributor
Posts: 12

Re: Trouble with the %CIF macro

I just discovered the same problem, and it works just fine if you change those sinle quotes to double.

 

Previously I was using an older version of this macro I found online, and I didn't encounter the bug until I use the autocall version.

 

And I'm new here - where do I report this?

Occasional Contributor
Posts: 6

Re: Trouble with the %CIF macro

Hi,

After running the following command - this time with double quotes - the title stil wont change. Am I doing it wrong?

 

%CIF (DATA=final, TIME=follow_up, STATUS=hypertension, EVENT=1, censored=0, GROUP=case, TITLE="Survival data");

 

Super User
Posts: 17,829

Re: Trouble with the %CIF macro

I believe you need to modify the actual macro code not the macro call. In the code change the single quotes to double quotes.
Super User
Super User
Posts: 6,500

Re: Trouble with the %CIF macro

On the old site the link was in the page footer.  On this new site click on the Contact link under the Connect column in the page footer. Then on that page click on the support link:

 

http://support.sas.com/ctx/supportform/createForm

 

Super User
Posts: 17,829

Re: Trouble with the %CIF macro

Not sure if this is useful, but If you have SAS 9.4 you can use Proc PHREG for Fine and Gray's Competing Risks model in SAS now. 

 

http://www.sas.com/content/dam/SAS/en_ca/User%20Group%20Presentations/Vancouver-User-Group/Gondara_C...

Super User
Posts: 17,829

Re: Trouble with the %CIF macro

Contact SAS tech support, open a track.
Occasional Contributor
Posts: 12

Re: Trouble with the %CIF macro

I encountered a different problem with the %CIF macro.

The error occurs if the Cumulative Incidence Function (CIF) ever reaches 1.0, which can occur if there are no competing or censored events in one of the groups. The EXP() function generates an error because it may be given a value larger than IML can evaluate. This occurs in the following code when cifEST[cifloc,2] is very close to 1.0:

lowci[cifloc] = cifEST[cifloc, 2]##exp((-z*cifEST[cifloc, 3]) /(cifEST[cifloc,2]#LOG(cifEST[cifloc,2]))); 
upci[cifloc] = cifEST[cifloc, 2]##exp((z*cifEST[cifloc, 3]) /(cifEST[cifloc,2]#LOG(cifEST[cifloc,2])));

 

 

which occurs 3 times in the macro.

 

This error can be avoided by inserting a MIN() function to prevent an overly large number from being evaluated, as follows:

lowci[cifloc] = cifEST[cifloc, 2]##exp((-z*cifEST[cifloc, 3]) /min(9999999,cifEST[cifloc,2]#LOG(cifEST[cifloc,2]))); 
upci[cifloc] = cifEST[cifloc, 2]##exp((z*cifEST[cifloc, 3]) /min(9999999,cifEST[cifloc,2]#LOG(cifEST[cifloc,2]))); 


Divide by zero warning can also occur here, but those do not cause the macro to fail.

 

Ask a Question
Discussion stats
  • 8 replies
  • 905 views
  • 2 likes
  • 4 in conversation