Re: [R] Coefficients from LM

From: Prof Brian Ripley <>
Date: Fri 16 Sep 2005 - 19:34:38 EST

On Fri, 16 Sep 2005, Dieter Menne wrote:

> Charles Annis, P.E. <Charles.Annis <at>> writes:
>> Here's an example with a glm; lm() works the same way but has fewer internal
>> objects.
>> mod3 <- glm(tree ~ altitude, family = binomial)
>> You can use names() to find out what's inside:
>>> names(mod3)
>> [1] "coefficients" "residuals" "fitted.values" "effects"
> You get more information about the internals by using str(mod3) instead of names
> (mod3).

Well, yes for a specific object but not for what the function returns in general and what it means. In this case (and most others), the help page is the best source of information about the return value.

However, in general it is best to use the supplied accessor functions such as coef() and residuals(), and these are covered in the introductory accounts of model fitting in S/R.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Wed Sep 21 01:33:41 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 17:00:54 EST