Martin Henry H. Stevens
2004-May-04 14:41 UTC
[R] degrees of freedom in lm() treatment contrasts
Does anyone have a good (and specific) reference for an explanation for the calculation of degrees of freedom in treatment contrasts? I checked the indexes of Venables and Ripley 2002, Crawley 2002, and Neter et al. (Applied Linear Statistical Models, 4th ed.), as well as the lm code. I would happily accept a "verbal" email explanation as well. Many thanks, Hank Stevens 338 Pearson Hall Botany Department Miami University Oxford, OH 45056 Office: (513) 529-4206 Lab: (513) 529-4262 FAX: (513) 529-4243 http://www.cas.muohio.edu/botany/bot/henry.html http://www.muohio.edu/ecology/ http://www.muohio.edu/botany/
Prof Brian Ripley
2004-May-04 17:23 UTC
[R] degrees of freedom in lm() treatment contrasts
The thing is, it is *terms* that have degrees of freedom, and that does not depend on the contrasts used except in rather exceptional circumstances (when you set them with C() being one). And the number of df assigned to a term depends on what went before, as well as the data (since you can extrinsic aliasing). The only source that is close to comprehensive is section 2.4 of the White Book (not an easy read, though). Do read V&R section 6.2 first. I teach my students via series of examples: the general principles seem too hard for beginners. On Tue, 4 May 2004, Martin Henry H. Stevens wrote:> Does anyone have a good (and specific) reference for an explanation for > the calculation of degrees of freedom in treatment contrasts? I checked > the indexes of Venables and Ripley 2002, Crawley 2002, and Neter et al. > (Applied Linear Statistical Models, 4th ed.), as well as the lm code. I > would happily accept a "verbal" email explanation as well. > Many thanks, > Hank Stevens-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595