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.
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:
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 ;
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.