Re: [R] contrats hardcoded in aov()?

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Fri 24 Jun 2005 - 00:12:22 EST

"RenE J.V. Bertin" <rjvbertin@gmail.com> writes:

> Hello,
>
> I was just having a look at the aov function source code, and see that when the model used does not have an Error term, Helmert contrasts are imposed:
>

> if (is.null(indError)) {
> ...
> }

> else {
> opcons <- options("contrasts")
> options(contrasts = c("contr.helmert", "contr.poly"))
> on.exit(options(opcons))
> ...
>
>
> My reading of several contributed user guides' sections on ANOVA is
> that Helmert contrasts are not intuitive at all and best avoided by
> non-expert users. This explains why I didn't see any influence of
> the various contrast settings on my results, and I wonder why this
> local shadowing of global settings is done?

I believe the reason is that you get in trouble further down the line if the contrast matrices do not sum to zero over rows, which basically implies contr.helmert or contr.sum.

There is some disagreement over whether this is a natural requirement for contrast matrices (Brian and I have discussed this previously, on this list I believe), but this is technical: the code assumes it and gives wrong results if it isn't true.

-- 
   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
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 Fri Jun 24 00:15:09 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:58 EST