Plotting estimated HR from coxph object with time-dependent coefficient and splines
问题 I want to plot the estimated hazard ratio as a function of time in the case of a coxph model with a time-dependent coefficient that is based on a spline term. I created the time-dependent coefficient using function tt , analogous to this example that comes straight from ?coxph : # Fit a time transform model using current age cox = coxph(Surv(time, status) ~ ph.ecog + tt(age), data=lung, tt=function(x,t,...) pspline(x + t/365.25)) Calling survfit(cox) results in an error that survfit does not