**trick to get predicted values on a new data set that is not included in the fit**; |
data dataall; set data0(in=in0) data1(in=in1); |
if in0 then wt=1; |
else if in1 then wt=0; |
proc phreg data=dataall; |
model time*event(0)=x; |
weight wt; |
output out=pred1 resmart=resmart xbeta=lp; |
**convert martingale residual into expected number of events**; |
data pred1;set pred1; |
p=event -resmart; |
logp=log(p); |
logbase= logp − lp; |
**model 1**; |
data data1;set pred1; |
if wt=0; **subset to new data**; |
proc genmod data=data1; |
model event= /offset=logp dist=poisson link=log; |
**model 2**; |
proc genmod data=data1; |
model event= logp / offset=logbase dist=poisson link=log; |
**model 3**; |
data data1;set data1; |
group=lp; |
proc rank data=data1 out=data2 groups=10; |
var group; |
proc genmod data=data2; |
model event= group /offset=logp dist=poisson link=log noint; |