如何在SAS数据集中打印Somers'D?

时间:2016-06-03 21:54:05

标签: sas logistic-regression logistics

正如标题所示,我想知道有一种方法可以在数据集中打印Somers'D统计数据和预测变量x的p值。

您只需运行以下内容即可获得此类统计信息:

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;

如果我运行类似于提议的here的代码,我只得到AIC,SIC,最后是LR stat和SAS log 我发现:

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;

在第一段代码中,而在第二段我发现以下内容:

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.

有些人可以建议在新数据集中打印此类统计信息的方法吗?

任何帮助将不胜感激。

谢谢!

1 个答案:

答案 0 :(得分:1)

我不知道为什么你没有得到ODS TRACE输出。我重新启动您的SAS版本或将其报告给SAS。

您想要的表称为Association和ParameterEstimates。 Somer的D需要创建赔率比率声明。

ods trace on;
ods output association=somers parameterestimates=pe;
proc logistic data=sashelp.heart;
model status=ageatstart;
oddsratio ageatstart;
run;
ods trace off;