I prefer smoothing splines, Frank prefers regression splines.  The
former is built into the survival package:

 options(na.action=na.exclude)  # This should be the default IMHO

 coxfit1<- coxph(Surv(rtime,rcens) ~ pspline(cts), data=data1)
 summary(coxfit1)   #shows the linear and nonlinear tests
 plot(data1$cts, predict(coxfit1))

or if you want confidence intervals, this gives the data to plot
 pr1 <- predict(coxfit1, type='terms', se=T)

Terry Therneau

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to