Displaying 1 result from an estimated 1 matches for "ova_mod".
2018 May 24
1
Predictions from a Cox model - understanding centering of binary/categorical variables
Dear all,
I am using R 3.4.3 on Windows 10. I am preparing some teaching materials and I'm having trouble matching the by-hand version with the R code.
I have fitted a Cox model - let's use the ovarian data as an example:
library(survival)
data(ovarian)
ova_mod <- coxph(Surv(futime,fustat)~age+rx,data=ovarian)
If I want to make predict survival for a new set of individuals at 100 days then that is trivial using predict.coxph e.g.:
newdata <- data.frame(futime=rep(100,5),fustat=rep(1,5),age=c(45,50,55,60,65),rx=c(1,2,1,2,1))
preds <- predict(ova_...