Dear Christophe and Ben,
Also see the car package for replacements for contr.treatment(),
contr.sum(), and contr.helmert() -- e.g., help("contr.Sum", package="car").
These functions have been in the car package for more than two decades,
and AFAIK, no one uses them (including myself). I didn'
It's sorta-kinda-obliquely-partially documented in the examples:
zapsmall(cP <- contr.poly(3)) # Linear and Quadratic
output:
.L .Q
[1,] -0.7071068 0.4082483
[2,] 0.000 -0.8164966
[3,] 0.7071068 0.4082483
FWIW the faux package provides better-named alternatives.
Thanks for your reply.
It might good to document the naming convention in ?contrasts. It is hard to
understand .L for linear, .Q for quadratic, .C for cubic and ^n for other
degrees.
For contr.sum, we could have used .Sum, .Sum…
Maybe the examples ?model.matrix should use names in dd objects s
You're at the mercy of the various contr.XXX functions. They may or may not set
the colnames on the matrices that they generate.
The rationales for (not) setting them is not perfectly transparent, but you
obviously cannot use level names on contr.poly, so it uses .L, .Q, etc.
In MASS, contr.s
Dear list,
Changing the default contrasts used in glm() makes me aware how model.matrix()
set column names.
With default contrasts, model.matrix() use the level values to name the
columns. However with other contrasts, model.matrix() use the level indexes. In
the documentation, I don’t see any
5 matches
Mail list logo