Hi! I am having a few problems with coxph function, I had the same problem with the use of survfit. Here it is:
when calling 'M22<-coxphw(Surv(V1,V2,V4)~V5, data=XTDV, id=XTDV$V3, * prentice*= ~V5, robust=TRUE, censcorr=TRUE)' knowning that my data is: > XTDV[1:10,1:3] V1 V2 V3 V4 V5 1 0 36.39706 36 1 343.2224 2 0 36.39706 943 0 161.5931 3 0 36.39706 45 0 790.3714 I get this message: "Error in w[i] <- w[i] * w.sorted[fit$time == obj$resp[i, 2]] : replacement has length zero". When I perform a debug I find that the problem is that the time returned by obj$resp[i,2] is for a certain i different from fit$time so all the vector is false....but in fact the difference is minimal and it doesn't do that with precedent values... Browse[2]> w.sorted[fit$time==obj$resp[2051,2]] numeric(0) Browse[2]> obj$resp[2051,2] [1] 49.53238 Browse[2]> fit$time[23] [1] 49.53238 Browse[2]> obj$resp[2051,2]-fit$time[23] [1] -7.105427e-15 maybe it's because the time I use is not integer? Like I said, I had the same problem using results from survfit but I fixed it by rounding values before comparing them. Is there a way to change the function coxphw? Thank you. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.