annaren wrote:I am having REAL problems making the design matrices for a model {Phi'(g*t) Phi (g*t) p(g*t)} with 4 trap ocassions and 4 groups.
I can run the model using PIMS but that means I can not add constraints to the model. When I try to view the design matrix for the model made using the PIM it says it can not build a full design matrix because there are 20 values in the PIMS but should be 24. When I try to contruct the design matrix myself I can not get the same output as when using the PIMS.
I have read chapters 7 and 8 in the MARK book a number of times now so I was wondering if anybody had any idea as to how to procede.
Always tricky to play with transient models (and TSM models in general), but if you write out the linear model, and then construct the DM from the linear model, they're not too bad - but you need to be careful when handling some of the interactions.
Consider a simpler problem first (invariable a good idea until you're comfortable with the concept) - two groups (call them males and females), 5 occasions. Assume we're only interested in transience on phi in an CJS-type study. The PIMs corresponding to this would be for males,
- Code: Select all
1 5 6 7
2 6 7
3 7
4
and females
- Code: Select all
8 12 13 14
9 13 14
10 14
11
The first trick is to remember that the linear model is essentially
Intcp + sex + age (within sex) + time + a*s + a*t + s*t + a*s*t
Most people forget to include the a*s interaction.
Thus, for this problem, the DM would look like
- Code: Select all
1 1 1 1 0 0 1 1 0 0 0 0 0 0 0
1 1 1 0 1 0 1 0 1 0 1 0 1 0 0
1 1 1 0 0 1 1 0 0 1 0 1 0 1 0
1 1 1 0 0 0 1 0 0 0 0 0 0 0 0
1 1 0 0 1 0 0 0 1 0 0 0 0 0 0
1 1 0 0 0 1 0 0 0 1 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 1 1 0 0 0 0 0 0 0 0 0 0 0
1 0 1 0 1 0 0 0 0 0 1 0 0 0 0
1 0 1 0 0 1 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 1 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 1 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
where
col 1 = incpt
col 2 = sex
col 3 = age (within sex - note offeset for TSM+1 age)
col 4 -> 6 = time (t1, t2, t3)
col 7 = s*a
col 8 -> 10 = s*t (s*t1, s*t2, s*t3)
col 11 -> 12 = a*t (a*t2, a*t3)
col 13 -> 14 = s*a*t (s*a*t2, s*a*t3)
Pay particular attention to how the interactions are handled - especially those wrt to time and age. Only logical interactions are included in the DM - see section 8.1.1.
Now, if you understand the preceding, then your problem is basically the same, except with more groups.