Diego,
There are two ways to build your design matrix. One way is to create an intercept column, year-effect column, food-effect column and interaction column. The design matrix would look like this:
- Code: Select all
b1 b2 b3 b4
p(96,1) 1 0 0.23 0
p(96,2) 1 0 0.23 0
p(96,3) 1 0 0.23 0
p(97,1) 1 0 0.45 0
p(97,2) 1 0 0.45 0
p(97,3) 1 0 0.45 0
p(98,1) 1 1 0.09 0.09
p(98,2) 1 1 0.09 0.09
p(98,3) 1 1 0.09 0.09
where b1=intercept, b2=year-effect, b3=food abund-effect, and b4=interaction=b2*b3.
The other way is to think of the two groups of years independently. The first two years would have intercept and food-effect columns, and the other year would have different intercept and food-effect columns. Here's the design matrix for that:
- Code: Select all
b1 b2 b3 b4
p(96,1) 1 0.23 0 0
p(96,2) 1 0.23 0 0
p(96,3) 1 0.23 0 0
p(97,1) 1 0.45 0 0
p(97,2) 1 0.45 0 0
p(97,3) 1 0.45 0 0
p(98,1) 0 0 1 0.09
p(98,2) 0 0 1 0.09
p(98,3) 0 0 1 0.09
where b1=intercept for 96-97, b2=food-effect for 96-97, b3=intercept for 98 and b4=food-effect for 98.
While you'll get different estimates of the betas (b1-b4), from the two methods, they should yield the same likelihood, AIC, and real parameter estimates (p's).
Jim