A few more comments: 1) fit$residuals is a *component* of a list, not an attribute.
2) Since n is evaluated as zero, this only affects the constant in AIC and model selection was unaffected. 3) fit$df is a vector, and you want sum(fit$df). I've updated the code in R-patched. On Wed, 21 Apr 2004, Prof Brian Ripley wrote: > There has been a change in the survreg function since that was written > .... > > On Wed, 21 Apr 2004, Stefano Calza wrote: > > > Hi everybody. > > > > I'm having problems with the extractAIC.survreg function and the edf > > > > I get weird results which I think are due to the fact that the function defines > > edf as (from the stats package in 1.9.0 source code) > > > > ... > > ... > > n <- length(fit$residuals) > > edf <- n-fit$df.residual > > ... > > > > But in a survreg object there's no attribute residuals!!?? > > > > if in the function I use instead > > > > ... > > n <- length(residuals(fit) > > ... > > > > everything's fine, or better > > > > ... > > edf <- fit$df > > ... > > > > Am I missing something? -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
