Skip to content

Meaning of pterms in survreg object?

7 messages · Johannes Hüsing, David Winsemius, Martin Maechler

#
I am trying to model survival data with a Weibull distribution                                                                         
using survreg. Units are clustered two apiece, sometimes receiving                                                                     
the same treatment and sometimes opposing treatment.                                                                                   
                                                                                                                                       
Residual and predict methods are not carried out on the survreg                                                                        
object, although the component linear.predictors exists for the                                                                        
survreg object. Looking at the code I see that the residual method                                                                     
refuses to run if any of the components of the pterms vector is                                                                        
equal to 2.                                                                                                                            
                                                                                                                                       
When taking the logarithm of the data and trying a linear mixed                                                                        
model, residuals and predicted values are produced just fine.                                                                          
                                                                                                                                       
So what is pterms and why is it that, when any component of it                                                                         
is 2, residuals are not allowed to be displayed?
17 days later
#
Is there a special mailing list for the survival package where my
question would have been more appropriate?

Johannes Huesing <johannes at huesing.name> [Mon, Jan 10, 2011 at 09:26:37PM CET]:

  
    
#
You got a perfectly sensible reply from Thereau,  the author of the  
package,  a day after your posting and then failed to respond to his  
questions. I'm not sure what more you are expecting.
#
David Winsemius <dwinsemius at comcast.net> [Thu, Jan 27, 2011 at 10:08:00PM CET]:
My apologies. Next time I'll be checking Gmane in addition to my
inbox for answers. Don't know what happened to the reply locally.
#
On Jan 28, 2011, at 12:37 AM, Johannes Huesing wrote:

            
And my apologies to Therneau for misspelling his name.
David Winsemius, MD
West Hartford, CT
#
Johannes Huesing <johannes at huesing.name> [Mon, Jan 10, 2011 at 09:26:37PM CET]:
I am using R 2.10.1, and here is some example code:

anzpat <- 32
device <- rep(unlist(expand.grid(list(c("C", "Z"), c("C", "Z")))),
              anzpat / 4)
bleedtimes <- exp(rnorm(anzpat * 2, 0, .3) + as.numeric(device) * log(3))
pat <- as.factor(rep(1:anzpat, each=2))

library(survival)

survmod <- survreg(Surv(sapply(bleedtimes, min, 10), bleedtimes < 10) ~ device + frailty.gaussian(pat))

residuals(survmod)

###  Fehler in residuals.survreg.penal(survmod) : 
###  Residualss not available for sparse models

survmod$pterms

###          (Intercept)                device frailty.gaussian(pat) 
###                    0                     0                     2
2 days later
#
JH> David Winsemius <dwinsemius at comcast.net> [Thu, Jan 27, 2011 at 10:08:00PM CET]:
    >> You got a perfectly sensible reply from Thereau,  the author of the
    >> package,  a day after your posting and then failed to respond to his
    >> questions. I'm not sure what more you are expecting.
    >> 

    JH> My apologies. Next time I'll be checking Gmane in addition to my
    JH> inbox for answers.

Gmane may be fine; but it is *NOT* the reference.
The reference to see what's posted or not are the mailing list
archives  "proper", https://stat.ethz.ch/pipermail/r-help/ ,
and they are available directly from
the https://stat.ethz.ch/mailman/listinfo/r-help url
at the bottom of every posting ...

Martin Maechler, ETH Zurich (= R-help list provider)

    JH>  Don't know what happened to the reply locally.


    JH> -- 
    JH> Johannes H?sing               There is something fascinating about science. 
    JH> One gets such wholesale returns of conjecture