BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello -
I am using a macro for proc logistic and would like to output results (OR, CI, pvalue) into table. Currently I am only able to output the beta estimates with the code I have and am not sure how to specify other statistics.

proc logistic data=XYZ outest=_est&k;

The problem is with the outest but I don't know what other options work here.
Any thoughts?

Thanks in advance.
3 REPLIES 3
Sheri
Calcite | Level 5
I don't know much about Proc Logistic, but maybe I can help.

Found this on the SAS site samples section for Proc Logistic:
"out= Names the output data set to contain the crossvalidated betas (named _CVB0 - _CVBn, where n is the number of explanatory variables and _CVB0 is the crossvalidated intercept), XBETAs, predicted probabilities, and predicted levels. If not specified, the data set is named CVOUT."

You have an output dataset containing the information you need, so you can export it out to Excel using code like this:

proc export data=CVOUT
outfile="PathName\WorkBookName.xls"
dbms=Excel2000 replace;
run;

Good luck.
deleted_user
Not applicable
Thanks very much!
Olivier
Pyrite | Level 9
With a lot of statistical procedures, you can recover infos that are displayed but not available through OUT something options : you just have to use the ODS OUTPUT statement.
In your case, something like :

ODS OUTPUT parameterEstimates = work.coefficients ;
PROC LOGISTIC DATA = xyz ;
etc.

The trick is to know what is the object name (here : parameterEstimates) that you need. There are different methods :
- in the Results windows, find the correct entry, right-click on it and chose properties (it is displayed in a new window and called NAME)
- run your program once, with
ODS TRACE ON / LISTING ;
at the beginning, and
ODS TRACE OFF ;
at the end.
In the Output window, you will have the same informations as above, but in plain text that you can copy and paste.
- in the SAS documentation, your will have a "Details" section for each statistical procedure. You will find in this section a "ODS TABLE NAMES" part, which lists all the objects that you can get with the ODS OUTPUT syntax.

One last thing about that : place the ODS OUTPUT statement at the line JUST BEFORE the PROC statement. If you type something between the two (even just a TITLE), the dataset will not be created.

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!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

Discussion stats
  • 3 replies
  • 1169 views
  • 0 likes
  • 3 in conversation