[R] Output predictions based on a Cox model
George Fraser
gfraser1 at staffmail.ed.ac.uk
Thu Jan 27 13:29:43 CET 2005
Hi,
I've generated a cox model, but I'm struggling to work out how to output
predctions based on the model I've made.
my.model<-coxph(Surv(duration,status) ~ gender + var1 + var2,
data=mydata)
My test data set looks something like this:
id,actualduration,gender,var1,var2
a,65,m,1,3
b,34,f,1,5
...
What i need to do is for each id, output a predicted duration based on
my cox model so that I can compare it with other models.
I've looked in the survival package, and the Design package, but I can
only see how to output survival probabilities. I'm probably missing
something obvious, but trawling the mail archives has been fruitless,
any suggestions?
Cheers,
George
More information about the R-help
mailing list