2
votes

I know how to use Rattle with R to apply logit model by separating dataset in model and validation case. May I get any clear guidance/information source how to do that in SAS. It might be possible using Proc Score and Proc logistic...some kind of below way...but I'm confused

<<<<>>>code block<<<<>>>>

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; score data=new out=out2; run;

proc print data=out2; run;

2

2 Answers

1
votes
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;
0
votes
/* 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;

There's another way to do this via PROC SCORE but I haven't been able to figure it out.

You'll then need to run diagnostics / model evaluation on the test2 dataset.
For example:

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;

Obviously, there are obviously multiple diagnostics you could use; but, this example is shown for completeness.