[R] help

Terry Therneau therneau at mayo.edu
Tue Sep 3 13:07:04 CEST 2013


The tt function is documented for coxph, and you are using cph.   They are not the same.

On 09/03/2013 05:00 AM, r-help-request at r-project.org wrote:
> tt<- function(x) {
>                  obrien<- function(x) {
>                    r<- rank(x)
>                    (r - 0.5)/(0.5 + length(r) - r)
>                  }
>                  unlist(tapply(x, riskset, obrien))
>              }
> hi,  i am newer in R. when dealing  with a survival data, i have found the variable progression was not met the PH assumption.the picture show the residual agaist time.So i  use Cox model for time-depandent varibles.   i  use the default tt in function coxph,but when i use tt in "f<-cph(Surv(os$Stime,os$Status==1)~Metastasis+Surgery+Post.chem. +Age+tt(Progression)+ ALP, data=os, x=T, y=T, surv=TRUE, time.inc=60)",it didn't work. i don't kown what the arg"riskset" is .i beg your help . can you help me write down a appropriate tt expression to let me use in cph. thanks.
>                                                                                                                                                        Zhongxin Dong
>



More information about the R-help mailing list