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

How to print the the Somers'D in a SAS dataset?

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

您只需运行ning:

就可以得到这样的统计数据
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;

如果我 运行 一个与提议的 类似的代码,我只得到 AIC、SIC,最后是 LR 统计数据,在 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.

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

我们将不胜感激。

谢谢!

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

您需要的表称为 Association 和 ParameterEstimates。 Somer's D 需要创建优势比语句。

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