From ggrothendieck at gmail.com  Thu Apr 22 13:30:16 2010
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Thu, 22 Apr 2010 07:30:16 -0400
Subject: [Rd] Bugs? when dealing with contrasts
In-Reply-To: <4BCFED80.30307@gmail.com>
References: <l2u971536df1004211100q9beecbep1bceb5bbbd3b8175@mail.gmail.com> 
	<4BCF5F60.7020203@gmail.com>
	<i2l971536df1004211343ibca0d37do8c2bd5470f43ba4f@mail.gmail.com>
	<4BCFED80.30307@gmail.com>
Message-ID: <h2k971536df1004220430y549b3aa3x9f6bfb6006c93d7b@mail.gmail.com>

On Thu, Apr 22, 2010 at 2:32 AM, Peter Dalgaard <pdalgd at gmail.com> wrote:
> Gabor Grothendieck wrote:
>> On Wed, Apr 21, 2010 at 4:26 PM, Peter Dalgaard <pdalgd at gmail.com> wrote:
> ...
>>> I.e., that R reverts to using indicator variables when the intercept is
>>> absent.
>>
>> Is there any nice way of getting contr.sum coding for the interaction
>> as opposed to the ugly code in my post that I used to force it? i.e.
>> cbind(1, model.matrix(~ fac)[,2:3] * scores)
>
> I think not. In general, an interaction like ~fac:scores indicates three
> lines with a common intercept and three different slopes, and changing
> the parametrization is not supposed to change the model, whereas your
> model inserts a restriction that the slopes sum to zero (if I understand
> correctly). So if you want to fit "ugly" models, you get to do a little
> ugly footwork.
>

OK. Thanks.  I guess that's fair.

> (A similar, simpler, issue arises if you want to have a 2x2 design with
> no effect in one column and/or one row (think clinical trial, placebo
> vs. active, baseline vs. treated. You can only do this us explicit dummy
> variables, not with the two classifications represented as factors.)
>
>
> --
> Peter Dalgaard
> Center for Statistics, Copenhagen Business School
> Phone: (+45)38153501
> Email: pd.mes at cbs.dk ?Priv: PDalgd at gmail.com
>



[Rd] Bugs? when dealing with contrasts
Gabor Grothendieck