[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GLM and interactions
From: |
John Darrington |
Subject: |
Re: GLM and interactions |
Date: |
Fri, 8 Jul 2011 07:19:28 +0000 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Thu, Jul 07, 2011 at 04:09:28PM -0400, Jason Stover wrote:
The binary encoding for category, drug, and the interaction term would
be something like this:
category:
1 --> 0
2 --> 1
drug:
1 --> 0 0
2 --> 1 0
3 --> 0 1
interaction (category * drug):
1 * 1 --> 0 0
1 * 2 --> 0 0
1 * 3 --> 0 0
2 * 1 --> 0 0
2 * 2 --> 1 0
2 * 3 --> 0 1
So, I have just multiplied each of the pairs. Notice most are mapped
to the origin. This isn't a problem, though, if we just want to test
for an interaction. If we take X to be our binary variable for
category, and Y_1, Y_2 for our binary variables for drug, we can write
our linear model this way:
response = intercept + b_1 * X + b_2 * Y_1 + b_3 * Y_2 + b_4 * X * Y_1
+ b_5 * X * Y_2 + error
How would this encoding look in the more general case where "category" had
(say) five
distinct values instead of only two?
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.
signature.asc
Description: Digital signature