Skip to content

plotting spline term when frailty term is included

1 message · Terry Therneau

#
On 03/02/2016 05:00 AM, r-help-request at r-project.org wrote:
There are 3 parts to the answer.
  1. The first is a warning: wrt to mixed effects Cox models, I shifted my energy to coxme 
over 10 years ago.  The "penalized add on to coxph" approach of the frailty function was 
an ok first pass, but is just too limited for any but the simplest models.  I'm unlikely 
fix issues, since there are others much higher on my priority list.

  2. As Dave W. pointed out, the key issue is that predict(type='terms') does not work 
with for a model with two penalized terms, when one is frailty and the other pspline. 
Termplot depends on predict.

  3. Again, as Dave W pointed out, the whole issue of what the "correct" answer would be 
gets much more complicated when one adds random effects to the mix; some things have not 
done because it is not clear where to go.  (Survival curves for a mixed effects model only 
recently got added to my "todo" list, even though it has been on the wish list forever, 
because I finally have a notion of what a good approach would be.)

In your case I'd advise an end run: fit the model using ns() instead of pspline.  I like 
smoothing splines better than regression splines, but the fact is that for most data sets 
they result in nearly identical answers.

Terry T