**trick to get predicted values on a new data set that is not included in the fit**; |
**use case weights of zero for the new data set**; |
data databoth; set data0(in=in0) data1(in=in1); |
if in0 then wt=1; |
else if in1 then wt=0; |
proc logistic des data=databoth; |
model y=x; |
weight wt; |
output out=pred1 xbeta=p; |
**model 1**; |
data data1;set pred1; |
if wt=0; **subset to new data**; |
proc logistic des data=data1; |
model y= /offset=p; |
**model 2**; |
proc logistic des data=data1; |
model y=p; |
**model 3**; |
data data1;set data1; |
group=p; |
proc rank data=data1 out=data2 groups=10; |
Var group; |
proc logistic des data=data1; |
Class group; |
Model y=group p /noint; |
**alternative: newer syntax to get predictions on a new data set**; |
proc logistic des data=data0 outmodel=model0; |
model y=x; |
proc logistic inmodel=model0; |
score data=data1 out=pred1; |
**convert predicted probability to linear predictor**; |
data pred1;set pred1; |
p=log(p_1/(1-p_1)); |