On Wed, 2007-07-11 at 16:41 +0200, hadley wickham wrote: > On 7/11/07, Marc Schwartz <[EMAIL PROTECTED]> wrote: > > Actually, in this case, looking at the code for: > > > > survival:::print.survreg > > > > would be better, as the p value is calculate there, rather than being > > part of the survreg object. As with many R functions, the p value is > > calculated in the print method for the object. > > I wish print methods wouldn't do that. Printing is supposed to be > about displaying existing create, not creating new values. > > Hadley
It has been occasionally confusing and I am not sure of the history behind the diverse approach. To borrow a phrase from the DoD TCSEC books[1], I don't have my S/R "Rainbow Books" at hand to research it. Both sets of colors are on shelves in my home office. The first time I came across this years ago, was with the p value for the F statistic in a simple linear model. it is calculated in: stats:::print.summary.lm while the individual term p values are calculated in summary.lm versus being part of the returned lm object itself. I have just become "behaviorally modified" to look in more than one place for such things... :-) Regards, Marc [1] http://en.wikipedia.org/wiki/Rainbow_Series ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.