Skip to main content
. Author manuscript; available in PMC: 2017 Aug 1.
Published in final edited form as: Stat Methods Med Res. 2013 Jul 30;25(4):1692–1706. doi: 10.1177/0962280213497434
**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;