I do not seem to grasp how contrasts are set for ordered factors. Perhaps someone can elighten me?
lm.ord < lm (RV ~ ordered (EV), example.df) lm.pol < lm (RV ~ EV + I(EV^2), example.df)
coef (lm.ord)
(Intercept) ordered(EV).L ordered(EV).Q
3.9497767 2.9740535 0.1580798
coef (lm.pol)
(Intercept) EV I(EV^2) 0.9015283 2.8774032 0.1936074
but the predictions are the same (except for some rounding):
table (round (predict (lm.ord), 6) == round (predict (lm.pol), 6))
TRUE
15
I thus conclude that the two models are the same and are just using a different parametrisation. I can easily interprete the parameters of the explicit polynomial but I started to wonder about the parametrisation of the ordered factor. In search of an answer, I did check the contrasts:
contr.poly (levels (ordered (example.df$EV)))
.L .Q[2,] 9.073264e17 0.8164966
[1,] 7.071068e01 0.4082483
The linear part basically seems to be 0.707, 0 (apart for numerical rounding) and 0.707. I can understand that any evenspaced parametrisation is possible for the linear part. But does someone know where the value of 0.707 comes from (it seems to be the squareroot of 0.5, but why?) and why the middle term is not exactly 0?
I do not understand the quadratic part at all. Wouldn't that need the be the linear part to the power of 2?
Thank you for your thoughts! Lorenz

Lorenz Gygax
Swiss Federal Veterinary Office
Centre for proper housing of ruminants and pigs
Tänikon, CH8356 Ettenhausen / Switzerland
Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.
Archive generated by hypermail 2.1.8, at Wed 10 Jan 2007  00:30:25 GMT.
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/rhelp. Please read the posting guide before posting to the list.