-Original Message-
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On
>> Behalf Of Douglas Bates
>> Sent: January-25-09 10:49 AM
>> To: Gang Chen
>> Cc: R-help
>> Subject: Re: [R] Interpreting model matrix columns w
ct.org [mailto:r-help-boun...@r-project.org]
On
> Behalf Of Douglas Bates
> Sent: January-25-09 10:49 AM
> To: Gang Chen
> Cc: R-help
> Subject: Re: [R] Interpreting model matrix columns when using contr.sum
>
> On Fri, Jan 23, 2009 at 4:58 PM, Gang Chen wrote:
> > With the foll
On Fri, Jan 23, 2009 at 4:58 PM, Gang Chen wrote:
> With the following example using contr.sum for both factors,
>
>> dd <- data.frame(a = gl(3,4), b = gl(4,1,12)) # balanced 2-way
>> model.matrix(~ a * b, dd, contrasts = list(a="contr.sum", b="contr.sum"))
>
> (Intercept) a1 a2 b1 b2 b3 a1:
With the following example using contr.sum for both factors,
> dd <- data.frame(a = gl(3,4), b = gl(4,1,12)) # balanced 2-way
> model.matrix(~ a * b, dd, contrasts = list(a="contr.sum", b="contr.sum"))
(Intercept) a1 a2 b1 b2 b3 a1:b1 a2:b1 a1:b2 a2:b2 a1:b3 a2:b3
11 1 0 1
4 matches
Mail list logo