[R] What are the return values of aov?
Peng Yu
pengyu.ut at gmail.com
Tue Sep 15 03:35:55 CEST 2009
You understand what I meant. I should say it more clearly in my original post.
Regards,
Peng
On Mon, Sep 14, 2009 at 7:30 PM, Greg Snow <Greg.Snow at imail.org> wrote:
> I think Penkyu is not asking for the statistical definitions, but rather some help for what the different parts of the object are. Elements like coefficients and residuals seem fairly obvious (but could still be somewhat ambiguous, are the residuals raw/standardized/studentized/etc.). Objects like call and terms are less obvious.
>
> I remember doing ?lm.object to get a help page detailing the objects, but that was probably in S-PLUS (not in the version of R on my laptop). In this case, many of the details are on the help page for lm, which is only obvious when you realize that aov is a wrapper for lm, but not quite so obvious for the beginner (so Peng Yu, look at ?lm).
>
> You can also examine the structure of the object using the str function (or tkListView in the TeachingDemos package). But most of the time you will not directly access these parts of the object. Look at the help pages ?coef, ?resid, and ?fitted for some examples, do a plot of the object for other examples.
>
> There are also several books and online documents that give examples of doing regressions/anovas showing how to use some of the parts of the aov/lm object, some of which have packages as companions with code and examples (MASS, hmisc, HSAUR, car, daag come to mind, there are probably a lot more).
>
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> greg.snow at imail.org
> 801.408.8111
>
>> -----Original Message-----
>> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
>> project.org] On Behalf Of David Winsemius
>> Sent: Monday, September 14, 2009 4:02 PM
>> To: Peng Yu
>> Cc: r-help at stat.math.ethz.ch
>> Subject: Re: [R] What are the return values of aov?
>>
>>
>> On Sep 14, 2009, at 5:29 PM, Peng Yu wrote:
>>
>> > Hi,
>> >
>> > I get the following variables. Instead of guessing what they mean, is
>> > there a centralized location in R help() that describes their meaning
>> > and usage?
>> >
>> >> names(afit)
>> > [1] "coefficients" "residuals" "effects" "rank"
>> > [5] "fitted.values" "assign" "qr" "df.residual"
>> > [9] "contrasts" "xlevels" "call" "terms"
>> > [13] "model"
>>
>> Probably not. Neither the help pages nor the R-help mailing list are
>> set up to teach you even basic statistics much less all of the
>> concepts needed to understand the reasons for creating all of items.
>> Buy yourself some books and start reading. The text which for many
>> years was the only source was "Modern Applied Statistics with S" and
>> if you had some grounding in basic statistics it might be one place,
>> but I'm guessing you might want to start with something more basic.
>>
>> [76] William N. Venables and Brian D. Ripley. Modern Applied
>> Statistics with S. Fourth Edition
>>
>> There are quite a few other texts that have come out in the last few
>> years:
>>
>> http://www.r-project.org/doc/bib/R-books.html
>>
>> Perhaps:
>> [32] Peter Dalgaard. Introductory Statistics with R.
>>
>> My favorite is Harrell's, "Regression Modeling Strategies", but it's
>> not an introductory text and it's not really designed to teach R/S+.
>>
>> You might also look at:
>> http://cran.r-project.org/other-docs.html
>>
>> --
>> David.
>>
>> >
>> > On Mon, Sep 14, 2009 at 4:01 PM, Jorge Ivan Velez
>> > <jorgeivanvelez at gmail.com> wrote:
>> >> Hi Peng,
>> >> Try
>> >> names( your_aov_object )
>> >> str( your_aov_object )
>> >> HTH,
>> >> Jorge
>> >>
>> >>
>> >> On Mon, Sep 14, 2009 at 4:58 PM, Peng Yu <pengyu.ut at gmail.com>
>> wrote:
>> >>>
>> >>> Hi,
>> >>>
>> >>> I don't quite understand what are the return values of aov. I know
>> >>> that it has 'coefficients'. But I need to know what all the other
>> >>> return values are. Can somebody let me know how to figure them?
>> >>>
>> >>> Value:
>> >>>
>> >>> An object of class 'c("aov", "lm")' or for multiple responses
>> of
>> >>> class 'c("maov", "aov", "mlm", "lm")' or for multiple error
>> >>> strata
>> >>> of class '"aovlist"'. There are 'print' and 'summary' methods
>> >>> available for these.
>> >>>
>> >>>
>> >>> Regards,
>> >>> Peng
>> >>>
>> >>> ______________________________________________
>> >>> R-help at r-project.org 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.
>> >>
>> >>
>> >
>> > ______________________________________________
>> > R-help at r-project.org 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.
>>
>> David Winsemius, MD
>> Heritage Laboratories
>> West Hartford, CT
>>
>> ______________________________________________
>> R-help at r-project.org 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.
>
More information about the R-help
mailing list