[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GLM and interactions
From: |
Jason Stover |
Subject: |
Re: GLM and interactions |
Date: |
Sat, 9 Jul 2011 12:29:43 -0400 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Sat, Jul 09, 2011 at 08:12:27AM +0000, John Darrington wrote:
> On Fri, Jul 08, 2011 at 03:09:24PM -0400, Jason Stover wrote:
>
> category (5 categories --> 4 degrees of freedom):
> a --> 0 0 0 0
> b --> 0 0 0 1
> c --> 0 0 1 0
> d --> 0 1 0 0
> e --> 1 0 0 0
>
> drug (3 categories --> 2 degrees of freedom):
> 1 --> 0 0
> 2 --> 1 0
> 3 --> 0 1
>
> drug * category ((5 - 1) * (3 - 1) = 8 degrees of freedom):
> a1 --> 0 0 0 0 0 0 0 0
> a2 --> 0 0 0 0 0 0 0 0
> a3 --> 0 0 0 0 0 0 0 0
> b1 --> 0 0 0 0 0 0 0 0
> b2 --> 0 0 0 1 0 0 0 0
> b3 --> 0 0 0 0 0 0 0 1
> c1 --> 0 0 0 0 0 0 0 0
> c2 --> 0 0 1 0 0 0 0 0
> c3 --> 0 0 0 0 0 0 1 0
> d1 --> 0 0 0 0 0 0 0 0
> d2 --> 0 1 0 0 0 0 0 0
> d3 --> 0 0 0 0 0 1 0 0
> e1 --> 0 0 0 0 0 0 0 0
> e2 --> 1 0 0 0 0 0 0 0
> e3 --> 0 0 0 0 1 0 0 0
>
> This is not the only valid encoding, but it's the one that occurred to
> me first. Many different encodings could be considered as being
> correct. The only constraint is that we need to estimate the mean of
> each factor/level combination by summing the coefficients available.
> And we do not want any more coefficients than necessary, lest we lose
> degrees of freedom for error (and hence our ability to estimate the
> variability).
>
> So there needs to be no particular relationship between the encoding of the
> interaction
> and the encoding of its composite variables? The only rules are:
> 1. Exactly N non-zero rows must be present, where N is the degrees of freedom.
> 2. In any row there may be no more than one non-zero elements.
> Hence, would the following also be a valid encoding?
>
> drug * category ((5 - 1) * (3 - 1) = 8 degrees of freedom):
> a1 --> 0 0 0 0 0 0 0 1
> a2 --> 0 0 0 0 0 0 1 0
> a3 --> 0 0 0 0 0 1 0 0
> b1 --> 0 0 0 0 1 0 0 0
> b2 --> 0 0 0 1 0 0 0 0
> b3 --> 0 0 1 0 0 0 0 0
> c1 --> 0 1 0 0 0 0 0 0
> c2 --> 1 0 0 0 0 0 0 0
> c3 --> 0 0 0 0 0 0 0 0
> d1 --> 0 0 0 0 0 0 0 0
> d2 --> 0 0 0 0 0 0 0 0
> d3 --> 0 0 0 0 0 0 0 0
> e1 --> 0 0 0 0 0 0 0 0
> e2 --> 0 0 0 0 0 0 0 0
> e3 --> 0 0 0 0 0 0 0 0
Yes, that one is fine.