Sas 对具有ID的数据集应用截断

Sas 对具有ID的数据集应用截断,sas,logistic-regression,Sas,Logistic Regression,我正在使用SAS并设法运行proc logistic,这给了我这样一个表 Classification Table Prob Correct Incorrect Percentages Level Event Non- Event Non- Correct Sensi- Speci- FALSE FALSE Event Event tivity ficity POS NE

我正在使用SAS并设法运行
proc logistic
,这给了我这样一个表

Classification Table
Prob    Correct Incorrect   Percentages
Level   Event   Non-    Event   Non-    Correct Sensi-  Speci-  FALSE   FALSE
                Event           Event           tivity  ficity  POS     NEG  J
0       33      0       328     0       9.1     100     0       90.9    .    99
0.02    33      62      266     0       26.3    100     18.9    89      0   117.9
0.04    31      162     166     2       53.5    93.9    49.4    84.3    1.2 142.3
0.06    26      209     119     7       65.1    78.8    63.7    82.1    3.2 141.5
如何将概率至少为0.6的
lib.POST\u 201505\u PRED
中数据行的ID包括在内

proc logistic data=lib.POST_201503 outmodel=lib.POST_201503_MODEL descending;
model BUYER = 
    age
    tenure
    usage
    payment
    loyalty_card
    /outroc=lib.POST_201503_ROC;
    Score data=lib.POST_201505 out=lib.POST_201505_PRED outroc=lib.POST_201505_ROC;
run;

我一直在网上阅读和搜索,但没有在上面找到任何东西。我一定是在搜索错误的关键字,因为我认为这是一个经常使用的过程。

结果表明,我只需要在
库中包含id。POST_201505

您只需要一个id语句来告诉SAS您的id变量识别您的观察值

proc logistic data=lib.POST_201503 outmodel=lib.POST_201503_MODEL descending;
    id ID; 
    model BUYER = age tenure usage payment loyalty_card
        /outroc=lib.POST_201503_ROC;
    Score data=lib.POST_201505 
        out=lib.POST_201505_PRED 
        outroc=lib.POST_201505_ROC;
run;
现在您的输出包含您所需的所有内容。 例如,打印被分配为买家的概率至少为0.6的ID

proc print data=lib.POST_201505_PRED (where=(P_1 GE 0.6));
    var ID P_1;
run;
您可以找到这些
id您的密钥语句

proc univariate data=psydata.stroop;
    id Subject;
    var ReadTime;
run;
**将最极端的ReadTime值报告为


)

因此,您在一个训练集上使用
Proc Logistic
构建了一个模型,并希望对验证集进行评分?什么具有或应该具有0.6的概率?是的,我还想选择概率为0.6及以上的ID。我想我真正的问题是如何将ID与概率分数关联请添加更多代码我添加了我的
proc logistics
代码。谢谢你的帮助!我在
id上找不到任何东西我在网上看了几个小时的片段。你能提供一个参考吗?我不记得是哪个文档让我走上了正确的道路,但在SAS/STAT中,有一个
ID yourKey
语句来识别你的观察结果是很常见的。见我的编辑上面。