【发布时间】:2017-06-23 23:30:33
【问题描述】:
我试图比较两个模型,其中较小的模型是我假设的最佳模型,而较大的模型是包含所有变量的完整模型。我想使用 proclogistic 中的“测试语句”来比较模型,以确定是否有任何其他变量可能很重要。问题是测试似乎没有识别我的分类变量(d),如下所示:
proc logistic data = test;
class d (param = ref ref = '0');
model y (event = '1') = a b c d;
test1: test c=d=0;
run;
This is the image of the error showing in the log
所以本质上我是在测试,看看 c 或 d 是否有可能成为模型中的重要预测因子。
另外,我不确定我是否正确使用了“测试语句”,因此我们将不胜感激。
以下是您可以使用的测试数据:
data test (drop=i);
do i=1 to 1000;
a=round(uniform(1)*4,.01);
b=round(uniform(1)*10,.01);
c=round(uniform(1)*7.5,.01);
if b<2 then d=1;
else d=0;
if i<500 then y=1;
else y=0;
output;
end;
stop;
run;
【问题讨论】: