我知道如何使用Rattle with R通过在模型和验证案例中分离数据集来应用logit模型。 我是否可以在SAS中获得任何明确的指导/信息来源。 有可能使用Proc Score和Proc logistic ......以下某种方式 方式...但我很困惑
<<<<<>>>代码块<<<<>>>>>
proc logistic data=logistic descending;
model credit = &varlist;
output out=out1 predprobs=(i);
score data=new out=out2;
run;
proc print data=out1(obs=n);
run;
proc print data=out2;
run;
proc logistic inmodel = model; 得分数据= new out = out2; 运行;
proc print data = out2; 运行;
答案 0 :(得分:1)
proc logistic data=train outest=est;
model y=x;
run;
proc score data=test score=est type=parms out=test2;
var x;
run;
data test2;
set test2;
prob=exp(y)/(1+exp(x));
run;
proc means;
run;
答案 1 :(得分:0)
/* develop model */
proc logistic data= train_data desc;
model response_var = <var list>;
/* output scored model into dataset */
output out= <train_data2> predicted= <name of predicted var - eg: p_hat>;
/* apply score to validation dataset */
score data= test out= test2;
run;
通过PROC SCORE
还有另一种方法可以做到这一点,但我无法弄明白。
然后,您需要在test2
数据集上运行诊断/模型评估。
例如:
proc rank data= test2 groups=10 out = test3 descending ties = high;
var P_1;
ranks pred_v1;
run;
proc sql;
select pred_v1, sum(response_var) as resp, count(*) as count
from test3
group by pred_v1
order by pred_v1 asc;
quit;
显然,您可以使用多种诊断方法;但是,显示此示例是为了完整性。