Re: [R] loglogistic cumulative distribution used by survreg

From: Terry Therneau <>
Date: Fri, 31 Oct 2008 09:43:02 -0500 (CDT)

> What is the cumulative distribution (with parameterization) used within
> survreg with respect to the log-logistic distribution?

> That is, how are the parameters linked to the survivor function?

Reference: Kalbfleisch and Prentice, The statistical analysis of failure time data, chapter 2. This is the basis for survreg.

Let z = (log(time) - X beta)/ scale = the transformed data. Then

       S(z) = 1/(1+exp(z)) = survival function.    

  fit <- survreg(Surv(time, status) ~ ph.karno + age + sex, data=lung,


  # Get the survival curve for a 60 year old male with Karnofsky score of 70

  tdata <- data.frame(age=60, sex=1, ph.karno=70)
  stemp <- 99:1/100
  xtemp <- predict(fit, newdata=tdata, type='quantile', p=1-stemp)
  plot(xtemp/365, stemp, xlab="Years", ylab='Survival', type='l')

I purposefully did not ask for the 0th percentile, which can cause problems with the logarithm, or the 100th percentile, which is infinite (and I'd like to keep the plot to a reasonable scale).

        Terry Therneau mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 31 Oct 2008 - 14:51:22 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 31 Oct 2008 - 15:30:20 GMT.

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

list of date sections of archive