Re: [R] parameterization of factor in R

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Wed 28 Dec 2005 - 06:58:45 EST

?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?

-- 
Brian D. Ripley,                  ripley@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

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed Dec 28 07:09:21 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:42 EST