[R] forcing a zero level in contr.sum
Bond, Stephen
Stephen.Bond at cibc.com
Thu Jul 8 15:02:05 CEST 2010
Peter,
I am asked to show seasonal effects vs a general averaged level without any seasonal effects. That's why contr.sum and not treatment.
The estimates show that some coefs are not stat different from 0, which is also the enforced total average. So, my understanding of model selection leads me to force certain seasons to be zero.
For example:
Y= a0 + b1 + Xb | factor=1
Y= a0 +Xb | factor=2
Y= a0 + b2 + Xb | factor=3
b1+b2=0 | which in this case means b1=-b2 but with more levels not necessarily
Stephen Bond |
-----Original Message-----
From: Peter Dalgaard [mailto:pdalgd at gmail.com]
Sent: Thursday, July 08, 2010 4:09 AM
To: Bond, Stephen
Cc: r-help at r-project.org
Subject: Re: [R] forcing a zero level in contr.sum
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?
As Berwin (indirectly) points out, you probably overlooked the how.many
argument to C().
However, are you _sure_ that you want to do this? This is like testing
that one treatment is exactly equal to the average of all other
treatments, which is a rather strange hypothesis.
--
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
More information about the R-help
mailing list