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

Hi everyone,

 

I have a deadline for doing this analysis and would really appreciate some help. 

 

I'm using a data registry where the outcome of interest is complication (var name COMPLIC coded as 1 or 0) and where I have two models---one only uses age (var name NEWAGE) and one uses both age and gender (names NEWAGE and MALESEX).

 

I went to this site (http://ncook.bwh.harvard.edu/sas-macros.html) and downloaded a macro for continuous NRI (file titled reclass.macros.v4.sas", attached). The format of the macro is CONTNRI(DSNAME,DETAIL,STATVAR,PROB1,PROB2) where DSNAME is my data set, Detail (2,1,0 options for level of detail in output), STATVAR is my outcome (COMPLIC), PROB1 is stored probabilities from the first model using only NEWAGE (I used a proc logistic with the following code after the model statement "output out=PROB1 p=phat1" to create data set PROB1 with predicted probabilities phat1 and for the age and sex model used similar to code to create PROB2 with predicted probabilities phat2. The phat1 and phat2 were added as columns to the original dataset and then I submitted the following %CONTNRI(DSNAME,1,COMPLIC,phat1,phat2) where DSNAME is the name of my dataset.

 

SAS generates an output table that is mostly blank and the errors I keep finding in the log are the following: 

 

"ERROR: The LISTING destination is not active; no select/exclude lists are available."

 

And then later on down lower:

 

"WARNING: Output 'Chisq' was not created. Make sure that the output object name, label, or
path is spelled correctly. Also, verify that the appropriate procedure options are
used to produce the requested output object. For example, verify that the NOPRINT
option is not used."

 

"ERROR: The LISTING destination is not active; no select/exclude lists are available.
ERROR: File WORK.CHISQ.DATA does not exist."

 

I have pasted the Macro here. Can anyone please help me figure out what needs to change to make this work? The originators of the MACRO at the link state that the code has been debugged but I can't seem to figure out how to fix the error. 

 

Thank you so much!

 

Aakash

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Is HTML your default output? 

You can turn on listing with the following line. Give that a try and see if it works, otherwise you may have to dive into the code to see if there's a bug. I would try the following before your macro invocation and see if that resolves the issue. 

 

ODS LISTING;

View solution in original post

4 REPLIES 4
Reeza
Super User

Is HTML your default output? 

You can turn on listing with the following line. Give that a try and see if it works, otherwise you may have to dive into the code to see if there's a bug. I would try the following before your macro invocation and see if that resolves the issue. 

 

ODS LISTING;
akeswani
Fluorite | Level 6

Dear Reeza, 

 

Thank you so much! the output was generated and it works. 

 

Definitely learned something today :-). 

 

Best,

 

Aakash

Reeza
Super User

So I tried the macro and with ODS LISTING on the results are generated. 

 

The code is a bit badly designed by explicitly referencing ODS LISTING for the exclude/select but that's not the end of the world. 

 

Tested using SAS University Edition, sample code below. 

 

proc logistic data=sashelp.heart;
class sex;
model status = sex weight;
output out=test1 p=prob1;
run;quit;

proc logistic data=sashelp.heart;
class sex;
model status = sex weight height;
output out=test2 p=prob2;
run;quit;

data want;
merge test1 test2;
run;


ods listing file='/folders/myfolders/mylist.lst';
%contnri(want,1,status,prob1,prob2);
akeswani
Fluorite | Level 6
Thank you!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 4 replies
  • 5327 views
  • 2 likes
  • 2 in conversation