design matrix/age class/trend

questions concerning analysis/theory using program MARK

design matrix/age class/trend

Postby Christian Ramp » Sat May 28, 2005 2:50 pm

Hello all!

I would like to ask a question about building design matrixes. I know that there has been considerable effort in the mark-book (I have the new) to explain that in great detail, but I am not sure that I have understood everything to transfer the information to the following problem. (Apologizes in advance if this is an ‘avoidable’ question).

I have 3 age classes, the first (calves) includes the first interval only and is time dependent, the second class includes the second and third interval (juveniles), and from the 4th interval on I have the third age class (adults). The second and the third class are constant. This is so far my best model.
Now I want to test/analyze if I have a (linear) trend in that third (adult) class. Therefore I have to build this model via the design matrix. I have changed the PIM and design matrix as shown below. (I have more occasions/years than the shown 8 but it is just an example).
I would like to ask if the design matrix is correct.
The problem I have is that in the results I do get a trend but it is polynomial (-x2), which I do not understand – so my first idea was, that my design matrix might not be correct.

Many thanks in advance
Christian

I hoe you can read it - it looked better in excel

1 8 8 9 10 11 12
2 8 8 10 11 12
3 8 8 11 12
4 8 8 12
5 8 8
6 8
7


Itcpt Age Age Time1 T2 T3 T 4 T5 T6 T*A T*A T*A T*A T*A
1 1 0 1
1 1 0 1 1
1 1 0 1 1
1 1 0 1 1
1 1 0 1 1
1 1 0 1 1
1 1 0
1 0 1
1 0 0 1
1 0 0 2
1 0 0 3
1 0 0 4
Christian Ramp
 
Posts: 7
Joined: Sun Jan 30, 2005 9:43 pm
Location: Montreal

ups

Postby Christian Ramp » Sat May 28, 2005 3:13 pm

It is not readable - sorry - I hpe that is better, though still everthing but perfect, but I did not find a quick way to make it better.


1 8 8 9 10 11 12
0 2 8 8 10 11 12
0 0 3 8 8 11 12
0 0 0 4 8 8 12
0 0 0 0 5 8 8
0 0 0 0 0 6 8
0 0 0 0 0 0 7


Itcpt Age Age Time1 T2 T3 T4 T5 T6 T*A T*A T*A T*A T*A
1 1 0 1 0 0 0 0 0 0 0 0 0 0
1 1 0 0 1 0 0 0 0 1 0 0 0 0
1 1 0 0 0 1 0 0 0 0 1 0 0 0
1 1 0 0 0 0 1 0 0 0 0 1 0 0
1 1 0 0 0 0 0 1 0 0 0 0 1 0
1 1 0 0 0 0 0 0 1 0 0 0 0 1
1 1 0 0 0 0 0 0 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 1 0 0 0 0 0 0 0
1 0 0 0 0 0 2 0 0 0 0 0 0 0
1 0 0 0 0 0 3 0 0 0 0 0 0 0
1 0 0 0 0 0 4 0 0 0 0 0 0 0
Christian Ramp
 
Posts: 7
Joined: Sun Jan 30, 2005 9:43 pm
Location: Montreal

Postby ganghis » Sat May 28, 2005 5:38 pm

Christian,

There are several problems with your design matrix. As it stands, it is highly overparameterized. First, the time by age interaction makes no sense because you aren't using time for any other age class but the first one. Second, you are confounding your linear trend with the time effect in year 4. Try this:

1 1 0 0 1 0 0 0 0 0
1 1 0 0 0 1 0 0 0 0
1 1 0 0 0 0 1 0 0 0
1 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 1 0
1 1 0 0 0 0 0 0 0 1
1 1 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
1 0 1 1 0 0 0 0 0 0
1 0 1 2 0 0 0 0 0 0
1 0 1 3 0 0 0 0 0 0
1 0 1 4 0 0 0 0 0 0

Thus the intercept gives survival for the second age class.

Cheers, Paul
ganghis
 
Posts: 84
Joined: Tue Aug 10, 2004 2:05 pm

another approach

Postby egc » Sun May 29, 2005 12:38 pm

Paul is of course correct - but there is a somewhat simpler approach which would probably suffice for your purposes - if you're not interesting in modling additive models for interactions among various age classes. Suppose you have the following PIM structure:


Code: Select all
1   8  8  9  10  11  12
    2  8  8  10  11  12
       3  8   8  11  12
          4   8   8  12
              5   8   8
                  6   8
                      7


3 age classes - first class spans a single year, with variation over time. Second class spans 2 years (age 1 -> 2, 2 -> 3), with no time variation. And age 3 has time variation.

The easiest way to construct the DM for this model is

Code: Select all
1 1 0 0 0 0 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0 0 0 0
1 0 0 1 0 0 0 0 0 0 0 0
1 0 0 0 1 0 0 0 0 0 0 0
1 0 0 0 0 1 0 0 0 0 0 0
1 0 0 0 0 0 1 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 1 1 0 0
0 0 0 0 0 0 0 0 1 0 1 0
0 0 0 0 0 0 0 0 1 0 0 1
0 0 0 0 0 0 0 0 1 0 0 0



This is the DM for the starting model, before you apply the linear constraint. Note that written this way, it doesn't allow for subsequent construction of additive models, but if you don't care about such models, then this is fine. Note that there are 12 rows, corresponding to the 12 parameters in the PIM. Rows 1 -> 7, and columns 1 -> 6 correspond to time-dependence for the first age class (given 7 intervals). Row 8 corresponds to the 'dot' model for the second age class. Rows 9 -> 12 and columns 9 -> 12, correspond to time-variation for the third age class.

Now, to modify this for (say) a simple linear trend for the final age class, you would simply change the time coding for the third age class, substituing an ordinal sequence 1 -> 4 for the trend (as discussed at length in the book).

Code: Select all
1 1 0 0 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0 0
1 0 0 1 0 0 0 0 0 0
1 0 0 0 1 0 0 0 0 0
1 0 0 0 0 1 0 0 0 0
1 0 0 0 0 0 1 0 0 0
1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 1 1
0 0 0 0 0 0 0 0 1 2
0 0 0 0 0 0 0 0 1 3
0 0 0 0 0 0 0 0 1 4



Same number of columns as in Paul's design matrix (which, given their equivalence, must be true).

The thing to keep in mind is that unless you want to build additive models, you don't need to write a DM in terms of a common intercept for all groups (where, in this case, the age classes are the groups). Of course, as stressed in the book, such additive models are often of interest, but not always (and may not always even make much sense given the structure of the model). As such, you can't really 'lose' if you build the DM using a common intercept approach, but, sometimes they are confusing (since you have to keep track of which age classes overlap in which time intervals). If you don't want additive models, the approach I've suggested is very easy to implement - you basically place the structure for each age class along the diagonal of the DM.
egc
Site Admin
 
Posts: 201
Joined: Thu May 15, 2003 3:25 pm

building DM

Postby Christian Ramp » Sun May 29, 2005 7:09 pm

Thanks Paul and Evan. I haven’t used DM a lot – besides simple ones (one or two groups)
I did not realize that I can place the structure of the age classes on the diagonal of the matrix.

I would like to ask one more question to see if I got the idea – about the additive/interaction model. (I know I can do it with PIM only but for DM construction in general). Let’s consider the transience model phi (2a*t) both age classes are time dependent. The DM of that model is shown in the mark-book (8-16) and contains the interaction terms. If I know build the model phi (2a t/c) thus time dependent first class but a constant second class, then I would have no interaction term age* time – since there is only the first age class time dependent. Correct?
Thus the DM should look like (with common intercept)


Code: Select all
1   1   1   0   0   0
1   1   0   1   0   0
1   1   0   0   1   0
1   1   0   0   0   1
1   1   0   0   0   0
1   0   0   0   0   0


And with the approach Evan suggested
Code: Select all
1   1   0   0   0   0
1   0   1   0   0   0
1   0   0   1   0   0
1   0   0   0   1   0
1   0   0   0   0   0
0   0   0   0   0   1


Is this correct?

Thanks again
Christian
Christian Ramp
 
Posts: 7
Joined: Sun Jan 30, 2005 9:43 pm
Location: Montreal

yes, but...

Postby cooch » Sun May 29, 2005 7:33 pm

While your DM's are correct, I'd strongly suggest spending some time studying chapter 7 and chapter 8, in detail. You need to understand what you're doing, before you dive into analyses.
cooch
 
Posts: 1654
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University


Return to analysis help

Who is online

Users browsing this forum: Google Adsense [Bot] and 1 guest