I've added a time-transform ability to coxph: here is an example

fit <- coxph(Surv(time, status) ~ age + tt(age) + sex, data=lung,
        tt=function(x, t, ...) x*log(t) )

The only role for tt() in the formula is to be noticed as a specials by
terms().  I currently have tt defined as a function
        tt <- function(x) 
It has to be exported in the namespace, documented, etc.

Is there a way to make tt() local to coxph, but still be found by
model.frame, so that it does not have to be global?   It would seem to
be neater to do a marker transform like s() in gam, cluster() in coxph,
etc in this way, where the meaning is local to the enclosing function.

Terry Therneau

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to