On 22-Nov-03 Ted Harding wrote:
> [...]
> I have a quantitative variable Y and a 4-level ordered factor A
> (with very unequal numbers at the different levels, by the way).
> 
> The command
> 
>   lm(Y ~ A)
> 
> returns (amongst other stuff) an intercept, and coefficients
> A.L, A.Q and A.C for the Linear, Quadratic and Cubic effects.
> 
> I'm trying to verify how R computes A.L, A.Q and A.C [...]

Thanks to Brian Ripley ('"contr.poly" and see MASS Ch 6'),
and Berwin Turlach (private response).

In particular, Berwin's revelation

  fm <- lm(Y ~ A)
  model.matrix(fm)

shows me exactly what is going on!

Best wishes to all,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <[EMAIL PROTECTED]>
Fax-to-email: +44 (0)870 167 1972
Date: 22-Nov-03                                       Time: 10:35:23
------------------------------ XFMail ------------------------------

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to