[R] forcing a zero level in contr.sum

Bond, Stephen
2010-07-07T20:04:52Z

Clarifying my question:

options(contrasts = c("contr.sum",
"contr.poly"))
> contrasts(fixw$snconv)
   [,1] [,2] [,3] [,4] [,5]
01    1    0    0    0    0
03    0    1    0    0    0
05    0    0    1    0    0
06    0    0    0    1    0
07    0    0    0    0    1
09   -1   -1   -1   -1   -1

I need to force the coefficient on level 03 to be zero.

Thank you.

Stephen Bond
-----Original Message-----
From: David Winsemius [mailto:dwinsemius at comcast.net]
Sent: Wednesday, July 07, 2010 3:44 PM
To: Bond, Stephen
Cc: r-help at r-project.org
Subject: Re: [R] forcing a zero level in contr.sum


On Jul 7, 2010, at 3:13 PM, Bond, Stephen wrote:

> I need to use contr.sum and observe that some levels are not
> statistically different from the overall mean of zero.
> What is the proper way of forcing the zero estimate? It seems the
> column corresponding to that level should become a column of zeros.
> Is there a way to achieve that without me constructing the design
> matrix?
> Thank you.

lm( formula = z ~ x + y + 0,   ...)  _might_ do something close to
what you want.