Desktop productivity for business analysts and programmers

Save Logistic regression results: question on by _impulation_;

New Contributor
Posts: 3

Save Logistic regression results: question on by _impulation_;

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:

data xx;

input y ex f;


0 0 45

0 1 5

1 0 10

1 1 40


proc logistic data=xx descending outest=outreg covout;

  class ex;

  model y = ex;

  freq  f;

  by _Imputation_;


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.

Super User
Posts: 13,913

Re: Save Logistic regression results: question on by _impulation_;

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.

New Contributor
Posts: 3

Re: Save Logistic regression results: question on by _impulation_;

Thanks Ballaardw,

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.

Community Manager
Posts: 3,452

Re: Save Logistic regression results: question on by _impulation_;

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;

   by _Imputation_;


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:

Output Added:


Name:       OddsRatios

Label:      Odds Ratios

Template:   Stat.Logistic.OddsRatios

Path:       Logistic.ByGroup5.OddsRatios



New Contributor
Posts: 3

Re: Save Logistic regression results: question on by _impulation_;

Posted in reply to ChrisHemedinger

Thanks Chris,

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 "

Ask a Question
Discussion stats
  • 4 replies
  • 3 in conversation