prathouz@health.bsd.uchicago.edu
2005-Apr-02 06:27 UTC
[Rd] print.glm() signif digits (PR#7765)
Hi -- I have found that by default the function print.glm() uses 3 significant figures when printing out null and model deviances and the aic. Of course, this is not wrong. But if a person fitted two nested models and compared the resulting deviances obtained from print.glm(), the resulting hypothesis test could indeed be wrong because of this rounding. The function summary() applied to a glm object gives a more precise printout and I think that print.glm() ought to as well by default. Thanks much. -- pr =========================================================================Paul Rathouz, Assoc. Professor ph 773-834-1970 Dept. of Health Studies, Rm. W-264 fax 773-702-1979 University of Chicago prathouz@health.bsd.uchicago.edu 5841 S. Maryland Ave. MC 2007 Chicago, IL 60637
Why did you file a bug report on something with is `not wrong' and indeed you can change? How does this correspond to the definition of a `bug' in the FAQ? Your analysis is in fact based on an incorrect assertion: the default is> args(print.glm)function (x, digits = max(3, getOption("digits") - 3), ...) and that defaults to 4 since getOption("digits") defaults to 7. The correct way to compare two deviances is by the anova() function, and the correct way to extract them is the deviance() function. (You seems to have a 1960s mindset of poring over lineprinter output from a statistical analysis: by the 1970s and GLIM we did not do that.) On Sat, 2 Apr 2005 prathouz@health.bsd.uchicago.edu wrote:> Hi -- I have found that by default the function print.glm() uses 3 > significant figures when printing out null and model deviances and the > aic. Of course, this is not wrong. But if a person fitted two nested > models and compared the resulting deviances obtained from print.glm(), the > resulting hypothesis test could indeed be wrong because of this rounding. > The function summary() applied to a glm object gives a more precise > printout and I think that print.glm() ought to as well by default. Thanks > much. -- pr-- Brian D. Ripley, ripley@stats.ox.ac.uk 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