0

As the title suggests, I wonder about there's a way to print the Somers'D statistics and the p-value of the predictor x in a dataset.

You can get such statistics by simply running:

ODS TRACE ON;
PROC LOGISTIC DATA = BETTING.TRAINING_DUMMIES NOPRINT; 
    MODEL Z1 (EVENT = '1') = D_INT_LNGAP_1;
        OPTIONS;
RUN;

ODS TRACE OFF;

ODS OUTPUT FITSTATISTICS=FITDS;
PROC LOGISTIC DATA = BETTING.TRAINING_DUMMIES NOPRINT; 
    MODEL Z1 (EVENT = '1') = D_INT_LNGAP_1;
        OPTIONS;
RUN;

If I run a similar code to the one proposed here, I get only the AIC, the SIC and finally the LR stat and in the SAS log I find:

10   ODS TRACE ON;
11
12   PROC LOGISTIC DATA = BETTING.TRAINING_DUMMIES NOPRINT;
13       MODEL Z1 (EVENT = '1') = D_INT_LNGAP_1;
14           OPTIONS;
15   RUN;

NOTE: PROC LOGISTIC is modeling the probability that z1=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: There were 3968 observations read from the data set BETTING.TRAINING_DUMMIES.
NOTE: PROCEDURE LOGISTIC used (Total process time):
      real time           0.07 seconds
      cpu time            0.04 seconds


16
17   ODS TRACE OFF;

in the first piece of code, while in the second I find the following:

18   ODS OUTPUT FITSTATISTICS=FITDS;
NOTE: Writing HTML Body file: sashtml.htm
19   PROC LOGISTIC DATA = BETTING.TRAINING_DUMMIES NOPRINT; 
20       MODEL Z1 (EVENT = '1') = D_INT_LNGAP_1;
21           OPTIONS;
22   RUN;

NOTE: PROC LOGISTIC is modeling the probability that z1=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: There were 3968 observations read from the data set BETTING.TRAINING_DUMMIES.
NOTE: PROCEDURE LOGISTIC used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds

WARNING: Output 'FITSTATISTICS' was not created.  Make sure that the output object name, label,
         or path is spelled correctly.  Also, verify that the appropriate procedure options are
         used to produce the requested output object.  For example, verify that the NOPRINT
         option is not used.

Some of you can suggest a way to to print such statistics in a new dataset?

Any help will be appreciated.

Thanks!

Community
  • 1
  • 1
QuantumGorilla
  • 583
  • 2
  • 10
  • 25
  • Possible duplicate of [How do I see what output options are available in my proc?](http://stackoverflow.com/questions/30896668/how-do-i-see-what-output-options-are-available-in-my-proc) – Reeza Jun 03 '16 at 22:01
  • Thanks for the comment @Reeza, but my problem is slightly different. Anyway, if I follow what joe asked the question for, I will get only the Information Criterion output (AIC, SIC) and the LR statistics. – QuantumGorilla Jun 03 '16 at 22:19
  • What table names did you see in the log when ran the code with ODS TRACE turned on? Which of those tables did you then create by re-running the code with the proper ODS OUTPUT statement(s)? – Tom Jun 03 '16 at 22:24
  • How is it not the same? Did you run ODS trace, find the relevant tables and save them? – Reeza Jun 03 '16 at 22:28
  • I think not it s the same because I don't find any table in the SAS Log. Anyway, probably I did something wrong and I posted both the script I copied and the output in the SAS Log @Reeza – QuantumGorilla Jun 03 '16 at 22:44
  • What version of SAS are you using? – Reeza Jun 03 '16 at 22:49
  • @Reeza the version 9.4 – QuantumGorilla Jun 03 '16 at 22:55
  • 1
    ODS TRACE is not showing anything because the NOPRINT option caused the proc to not generate anything. – Tom Jun 03 '16 at 23:18
  • Yep @Tom, that's true! Thanks for the further suggestion. Sorry but I'm a beginner in SAS. – QuantumGorilla Jun 03 '16 at 23:24

1 Answers1

1

I don't know why you're not getting ODS TRACE output. I'd restart your SAS version or report it to SAS.

The tables you want are called Association and ParameterEstimates. Somer's D requires the Odds Ratio statement to be created.

ods trace on;
ods output association=somers parameterestimates=pe;
proc logistic data=sashelp.heart;
model status=ageatstart;
oddsratio ageatstart;
run;
ods trace off;
Reeza
  • 20,510
  • 4
  • 21
  • 38