Re: [R] Coefficients from LM

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri 16 Sep 2005 - 19:34:38 EST

On Fri, 16 Sep 2005, Dieter Menne wrote:

> Charles Annis, P.E. <Charles.Annis <at> StatisticalEngineering.com> 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,                  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

______________________________________________
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
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