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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

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