[R] parameterization of factor in R

Spencer Graves spencer.graves at pdf.com
Tue Dec 27 21:27:05 CET 2005


	  If you are not familiar with MASS (Modern Applied Statistics with S, 
4th ed, Venables and Ripley 2002, Springer), I can assure you it is an 
excellent reference for learning R.  There are many books on R that I 
have not read, but among the books in my personal library, I refer to 
MASS fairly frequently.  If it is beyond your budget and not in a local 
library, I encourage you to investigate the possibility of having that 
library obtain a copy.  If the library needs justification, please 
explain what you know of the book, how it became recommended for you, 
the problems you hope it will help you solve, etc.

	  Spencer Graves

Prof Brian Ripley wrote:

> ?contr.sum
> 
> And Chapter 6 of MASS would have explained all this to you, so if you have 
> further questions please consult it.
> 
> On Tue, 27 Dec 2005, Oana Mocila wrote:
> 
> 
>>I encountered this problem with parameterization in R:
>>
>>I have two factors in a regression. how about if I want to
>>set constraint so that for each factor, the sum of their
>>coefficients equals to zero(instead of choosing a reference
>>category)? for example, I have factor(variable) A(with three
>>categories) and factor(variable) B(with 4 categories), and I want
>>to parameterize so that the sum of the three coefficients of
>>A = 0, and sum of the four coefficients of B = 0? I
>>mean how to do it in R?
> 
> 

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves at pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915




More information about the R-help mailing list