[R] Difference in ANOVA results - R vs. JMP/Minitab
John Fox
jfox at mcmaster.ca
Wed Nov 19 15:57:40 CET 2003
Dear Nirmal,
At 09:12 AM 11/19/2003 -0500, Nirmal Govind wrote:
>Thank you very much John and Sundar for your quick responses.
>
>> From your description, it's not possible to tell what you did or
>> exactly what happened -- either in R or in Minitab (and JMP).
>
>John: in R, I fit the model using lm exactly as you did.. however, for the
>ANOVA table, I used summary(lm) and also tried aov(lm) but not anova(lm)
>... and it looks like therein lies the problem.. the output of these differ.
>
>What's the difference between aov, summary and anova? And when should one
>use one as opposed to the other? It's hard to tell from the help for these
>functions...
Briefly, as ?aov mentions, aov() calls lm() -- the difference is in the
results produced by generic functions like summary(), print(), etc. For
example, summary.lm() produces a table of coefficients, std. errors, etc.,
while summary.aov() produces an ANOVA table. One would not normally call
aov() with a linear-model object as an argument (though this works).
Applied to a linear-model object, summary() produces coefficients, etc. (as
mentioned), while anova() produces a (sequential) ANOVA table. This seems
apparent to me from the output.
More generally, it probably makes sense to read introductory material about
R -- such as the introductory manual that comes with the software or one of
several books (some freely available on the Internet) that describe its use
(see under documentation at <http://www.r-project.org/>).
John
-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
More information about the R-help
mailing list