Re: [R] survival package - pspline

From: Thomas Lumley <>
Date: Wed 17 May 2006 - 02:52:20 EST

On Tue, 16 May 2006, Birgit Rauchenschwandtner wrote:

> help
> Hello,
> I´m a statistic student in Austria and I have to do a survival analysis in R
> by using psplines as regressor. My problem is that I sometimes (I think it
> depends on the choose of the parameters) get a error message, but I do not
> know what it means. After that I tried the procedure with an example dataset
> R is providing. Although using the cancer dataset I also get this message.
> Input: survreg(Surv(time, status) ~ pspline(age,degree=0,nterm=4), cancer)
> Output: Fehler in if (!doing.well && old$half < 2) { :
> Fehlender Wert, wo TRUE/FALSE nötig ist

Since the default value of df in pspline is 4 this is the same as

That is, you are asking for 4 (df) degrees of freedom from a spline with only 4 (nterms) basis functions, which isn't possible.

Changing this to pspline(age,df=4,degree=0,nterm=5) works, but still is not very useful. The point of using penalized splines rather than ordinary regression splines is lost if you don't penalize them. I also don't understand why you want degree=0 splines, but they will work if you allow more basis functions than degrees of freeedom.

The error message could be more helpful, and I will change it.


Thomas Lumley			Assoc. Professor, Biostatistics	University of Washington, Seattle

______________________________________________ mailing list PLEASE do read the posting guide! Received on Wed May 17 02:58:50 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 17 May 2006 - 04:10:09 EST.

Mailing list information is available at Please read the posting guide before posting to the list.