Pregunta

I'd like to investigate a presumed U-shaped association of some continuous risk factor with my disease of preference using Cox proportional hazards regression. So far, I've done this with R and the survival package like so

library(survival)
coxph(Surv(entry, exit, status) ~ pspline(my.risk.factor, df = df))

However, although the documentation is unfortunately not too verbose, it seems to me that these splines are not restricted (i.e., forced to be linear in the tails) and therefore show high variance in said tails, and it also annoys me that I have to supply the desired complexity of the fit (by the df argument). I'd much rather have it like in the mgcv package, which can automatically regulate the complexity of the fit, but does AFAIK not support cox models.

Can I do it with R, and if so, how?

¿Fue útil?

Solución

The 'rms' package uses rcs (restricted cubic splines) which Harrell specifically states are linear in the tails and that agrees with my experience. You do not get auto df estimation as you might in the 'mgcv' package..

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top