[R] survival package - pspline

Thomas Lumley tlumley at u.washington.edu
Tue May 16 18:52:20 CEST 2006


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
   pspline(age,df=4,degree=0,nterm=4)
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

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle


More information about the R-help mailing list