From: Thomas Lumley (tlumley@u.washington.edu)
Date: Sat 24 Feb 2001 - 02:55:56 EST
Message-ID: <Pine.A41.4.33.0102230847050.163630-100000@homer03.u.washington.edu>
On Thu, 22 Feb 2001, Daniel A. Powers wrote:
> Meles --
>
> Here are a couple of routines. One computes Aalen's estimate of the
> cumulative hazard and the other a log-likelihood based on it
>
Yes, but if you do
aalen<-function(fit, remove.centering=FALSE){
s<-survfit(fit)
H<- -log(s$surv)
if (remove.centering)
H<-H*exp(-coef(fit)*fit$means)
data.frame(t=s$time,Lambda=H)
}
you have the advantage that it still works for left-truncated data, and if
you want it at the mean rather than at zero it works for stratified models
as well. In my experience it is extremely unusual that you want to do the
numerically unstable transformation to get the baseline hazard at Z=0.
Similarly, the loglikelihood is available in fit$loglik. This works for
left-truncated data, tied failure times, and stratified models and doesn't
require a quadratic-time algorithm.
Given the recent demand I'll add a cumulative hazard function for the next
release.
-thomas
Thomas Lumley Asst. Professor, Biostatistics
tlumley@u.washington.edu University of Washington, Seattle
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
This archive was generated by hypermail 2b30 : Fri 22 Jun 2001 - 18:58:33 EST