12-19-2012 10:44 AM
Hey SAS EG users,
I am new to SAS and my question is very basic and may have been asked before. I apologize for that and appreciate if you could point me the link to previous posts.
I try to save results from Logistic regression. I followed the Example 55.3, Reading Regression Results from a DATA= EST Data Set, from SAS 9.22 User Guide. But I met an error. Any suggestion are appreciated.
My code and data is as following:
input y ex f;
0 0 45
0 1 5
1 0 10
1 1 40
proc logistic data=xx descending outest=outreg covout;
model y = ex;
proc mianalyze data=outreg edf=98;
modeleffects intercept ex;
And the error message in the log file as the following:
NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
ERROR: Variable _IMPUTATION_ not found.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.OUTREG may be incomplete. When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.OUTREG was not replaced because this step was stopped.
12-19-2012 11:20 AM
The example you are looking at used a data set named OUTMI created by PROC MI that added the varaible _IMPUTATION_. Your data set XX doesn't contain that variable so there is an error.
12-20-2012 08:35 AM
Back a few pages from the User`s guide, the example does use an imputed data.
Still, my questions remains-- how to save the estimates, odds, standard errors and P values to an external file? I use remote access so that I cannot see the regression result directly.
I have tried: outest=dataset but it only give me the estimates but not the rest.
Thank you very much for your time. Any suggestions are appreciated.
12-20-2012 09:24 AM
You can always use ODS Output to select the output tables as data sets.
ods output OddsRatios=OddsRatios;
proc logistic data=outmi outest=outreg covout ;
model Oxygen= RunTime RunPulse;
To see the available output tables produced by ODS, put ODS TRACE ON; ahead of your PROC LOGISITIC step. The tables names will appear in the log:
Label: Odds Ratios
12-20-2012 10:53 AM
I have been testing ODS this morning and a small mysterious mistake takes me a lot of time, though I thought it should not be the problem.
The testing code is as following:
ods output "Parameter Estimates"=parest;
proc reg data=hsb25 noprint;
model write = female math;
ods output close;
proc print data=parest;
With the NOPRINT option inside the PROC REG, any names other than PAREST will not generate the output data set.
Finally I found the following from SAS user guide :
"Many SAS procedures support a NOPRINT option that you can use when you want to create an output data set but without displaying any output....However, if you specify the NOPRINT option, the procedure might not send any output to ODS. In most procedures that support a NOPRINT option, NOPRINT means no ODS "