JY J
JY J

Reputation: 21

Dealing with variables violating proportional hazard assumption, is it okay to use both step function and time-transform function simultaneously?

I tried to fit survival model with 4 variables violating proportional hazard assumption. I read following vignette (https://cran.r-project.org/web/packages/survival/vignettes/timedep.pdf) and seared online thoroughly, but could not find similar cases. .

Is it okay to use step function for variables violating proportional hazard assumption? For example,

vet2 <- survSplit(Surv(time, status) ~ ., data= veteran, cut=c(90, 180),
episode= "tgroup", id="id")
fit <- coxph(Surv(tstart, time, status) ~ var1:strata(tgroup) + var2:strata(tgroup) + var3:strata(tgroup) + var4 + var5 + var6, data=vet) 

Or use step function and time-transform function simultaneously? Such as,

fit1<-coxph(Surv(tstart, time, status) ~ var1:strata(timegroup) + var2:strata(timegroup)+ tt(var3) + var4 + var5 + var6, 
                                         data=vet,
                                         tt=function(x, t, ...) x*log(t+20))

looking forward to help!!

Upvotes: 0

Views: 67

Answers (0)

Related Questions