0

To give a basic summary, I'm trying to compare a cox-ph model, and a joint mode. My data has these patients which have survived up to time 25. For some reason however, my survival curve will start to decrease at time 10, and I'm so confused as to why. I'm certain it has something to do with my excel. This is the patient I'm using:

Patient   Time  death    Y     obstime    risk gender start stop  event age slope
15        25    0        130    20        high  1       20    25    0   40  -0.2

This is the code:

ND2<-cholnew.id[cholnew.id$patient=="15",]

coxFitXARS.chol<-coxph(Surv(Time,death)~ sex+age+risk+slope,data=chol.id,x=TRUE)
plot(survfit(coxFitXARS.chol,newdata=ND2,last.time="obstime"),mark.time=FALSE,col="red",xlab = "Time", ylab="Survival Probability",main="Patient 15 (using basic cox)")

Any ideas why this may the case would be greatly appreciated.

scoa
  • 19,359
  • 5
  • 65
  • 80
Devon
  • 61
  • 4
  • 1
    Welcome to SO! You should take a look at this page: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and edit your question afterwards so it includes a reproducible example. – scoa Aug 24 '16 at 15:09
  • At what time is your first death in the sample? My guess is at time 10. If it is at 10, your sample indicates that the first 10 days there are no deaths, i.e., there is no hazard (h(t) = 0) in the first 10 days, so the survival curve will be a flat line the first 10 days. – StatMan Sep 01 '16 at 11:25
  • Your title says "as opposed to 20". I see 20 in the `obstime` column in your dataset. What is `obstime`? The starting time of your observation? If yes, you should change the dependent variable in the `coxph` to `Surv(obstime, Time, death)` – StatMan Sep 01 '16 at 11:35

0 Answers0