I encountered following problem when plotting survival against an individual covariate using the function ‘covariate.predictions’:
I have as a group variable: population; coded as “pop1” and “pop2” and as individual covariate: “speed”. We expect survival to be higher when an individuals speed is higher and that the effect differs between the two populations. I build following model:
do.model=function(){
Phi.speed=list(formula=~population+speed)
p.time=list(formula=~time)
cml=create.model.list("CJS")
results=mark.wrapper(cml,data=hag.process,ddl=hag.ddl,adjust=FALSE)
return(results)}
modelcov=do.model()
When I look at the output file, the PIM’s for Phi are :
INPUT --- group=1 Phi rows=4 cols=4 Triang ;
INPUT --- 1 1 1 1 ;
INPUT --- 1 1 1 ;
INPUT --- 1 1 ;
INPUT --- 1 ;
INPUT --- group=2 Phi rows=4 cols=4 Triang ;
INPUT --- 2 2 2 2 ;
INPUT --- 2 2 2 ;
INPUT --- 2 2 ;
INPUT --- 2 ;
Now when I use
Phispeed=covariate.predictions(modelcov,data=data.frame(speed=speed.values),indices=c(1,2))
I get EXACTLY the same survival estimates in both populations (index 1 and 2 if I understand correctly). While they should differ, based on the real beta estimates. I even tried to recode my population as 0 and 1, but with no improvement. Can anyone suggest what I do wrong here?
Many thanks in advance,
Vincent.