[R] reference on contr.helmert and typo on its help page.

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sun Nov 8 18:28:54 CET 2009


Gabor Grothendieck wrote:
> On Sun, Nov 8, 2009 at 11:59 AM, Peng Yu <pengyu.ut at gmail.com> wrote:
>> On Sun, Nov 8, 2009 at 10:11 AM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
>>> On 08/11/2009 11:03 AM, Peng Yu wrote:
>>>> I'm wondering which textbook discussed the various contrast matrices
>>>> mentioned in the help page of 'contr.helmert'. Could somebody let me
>>>> know?
>>> Doesn't the reference on that page discuss them?
>> It does explain what the functions are. But I need a more basic and
>> complete reference. For example, I want to understand what 'Helmert
>> parametrization' (on page 33 of 'Statistical Models in S') is.
>>
> 
> Just google for: Helmert contrasts

Or,

 > contr.helmert(5)
   [,1] [,2] [,3] [,4]
1   -1   -1   -1   -1
2    1   -1   -1   -1
3    0    2   -1   -1
4    0    0    3   -1
5    0    0    0    4

 > MASS::fractions(MASS::ginv(contr.helmert(5)))
      [,1]  [,2]  [,3]  [,4]  [,5]
[1,]  -1/2   1/2     0     0     0
[2,]  -1/6  -1/6   1/3     0     0
[3,] -1/12 -1/12 -1/12   1/4     0
[4,] -1/20 -1/20 -1/20 -1/20   1/5

and apply brains.

I.e., except for a slightly odd multiplier, the parameters represent the 
  difference between each level and the average of the preceding levels.

-- 
    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 at biostat.ku.dk)              FAX: (+45) 35327907




More information about the R-help mailing list