[R] Understanding lm-based analysis of fractional factorial experiments

Kjetil Kjernsmo kjekje at ifi.uio.no
Thu Mar 7 14:45:55 CET 2013


On Wednesday 6. March 2013 14.50.23 Ben Bolker wrote:
>    Just a quick thought (sorry for removing context): what happens if
> you use sum-to-zero contrasts throughout, i.e.
> options(contrasts=c("contr.sum", "contr.poly")) ... ?

Ah, I've got it now, this pointed me in the right direction. Thanks a lot!

For future reference, the default was "contr.treatment", which implies 
> contrasts(leaf$B)
  +
- 0
+ 1

using contr.sum, we get

> contrasts(leaf$B)
  [,1]
-    1
+   -1

which is orthogonal, and also explains the switched sign.

Kjetil



More information about the R-help mailing list