Skip to content
Prev 68626 / 398506 Next

survreg with numerical covariates

Ales - I have identified the problem. It is caused by missing data. In 
my previous posting I was analysing a dataset which happened to have 190 
missing values in the covariate. I compared two models:

r0 <- survreg(s ~1)
r1 <- survreg(s~x)
anova(r0,r1)

I was using anova to investigate the significance of adding covariates 
to the model, rather than printing out the results of a survreg() 
directly, and this was the problem. The behaviour of anova() is subtly 
different when applied to lm() or survreg().  With lm(), if the models 
compared have different numbers of missing observations, you get a 
warning, but with survreg(), the difference in observation count shows 
up as a large change in the df and deviance, giving the appearence that 
the covariate has been fitted as a factor with 191 levels.

So my fault, although possibly anova(survreg()) should be consistent 
with anova(lm()).


-Richard
Ales Ziberna wrote: