[R] Escobar&Meeker example survreg

Drescher, Michael (MNR) michael.drescher at ontario.ca
Fri Jun 8 22:33:29 CEST 2007


Dear all,

I am new to R and may make beginner mistakes. Sorry.

I am learning using R to do survival analysis. As a start I used the
example script code provided in the documentation of predict.survreg of
the survival package:

# Draw figure 1 from Escobar and Meeker
fit <- survreg(Surv(time,status) ~ age + age^2, data=stanford2,
dist='lognormal')
plot(stanford2$age, stanford2$time, xlab='Age', ylab='Days',
xlim=c(0,65), ylim=c(.01, 10^6), log='y')
pred <- predict(fit, newdata=list(age=1:65), type='quantile', p=c(.1,
.5, .9))
matlines(1:65, pred, lty=c(2,1,2), col=1)

When I compare the graphical output with Fig. 1 of Escobar and Meeker
(1992), I find that my output produces quantiles that are sloping down
linearly with age. The quantiles in Fig. 1 of Escobar and Meeker (1992)
however are obviously non-linear. I compared this with the corresponding
section in the S-Plus manual and found that the R and S-Plus are
virtually identical (as they should) and that the predicted quantiles in
S-Plus (Fig. 31.3) are also non-linear.

I checked the obvious help files and R-archive and found nothing on
this. I must be making a very basic mistake but can't find it.

Your feedback would be highly appreciated.

Best, Michael



Ref: Escobar and Meeker (1992). Assessing influence in regression
analysis with censored data. Biometrics, 48, 507-528.



More information about the R-help mailing list