cmb wrote:I am a new Mark user, and have what is probably a fairly basic question.
Which at this point leads to the suggestion make sure you've read the relevant documentation before plunging too far...
I'm try to fit a model with two age structures. Before doing anything fancy (constraining the model) I want to be certain I know what's going on with the fully time-dependent model. Consequently I've set up the model using the PIMs as described in the latest Mark book, and get a reasonable fit.
(PIM modeled as follows, though obviously larger)
1 7 8 9 10 11
. . 2 8 9 10 11
. . . 3 9 10 11
. . . . . 4 10 11
. . . . . . . 5 11
. . . . . . . . . 6
As constraining the model requires working with the design matrix, my first step was to construct the dm that corresponds to the fully time-dependent PIM, something like the following:
1 1 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0 0
1 1 0 1 0 0 0 1 0 0 0
1 1 0 0 1 0 0 0 1 0 0
1 1 0 0 0 1 0 0 0 1 0
1 1 0 0 0 0 1 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0
1 0 0 1 0 0 0 0 0 0 0
1 0 0 0 1 0 0 0 0 0 0
1 0 0 0 0 1 0 0 0 0 0
1 0 0 0 0 0 1 0 0 0 0
I run this model and get exactly the same mean estimates (which is encouraging) as when using the PIM, but the SE of some of these estimates are different from the those generated using the PIM. And the total deviance quoted is also (marginally) different. The differences are so small that I suspect they're unimportant and probably reflect the message that pops up when using the PIM method - that prompts to use the identity matrix as no other is defined. The difference between using the identity matrix and the design matrix I specified might be the key to these small differences, but I would like to understand this more fully if possible.
Hope someone can help,
Colin
"Something like" doesn't help much - post the full PIM and DM structure, it helps folks answer questions. But, to the point at hand...
As discussed at length in Chapter 8, if the PIM is
- Code: Select all
1 6 7 8 9
2 7 8 9
3 8 9
4 9
5
then the DM corresponding to this PIM is either
1 1 1 0 0 0 0 0 0
1 1 0 1 0 0 1 0 0
1 1 0 0 1 0 0 1 0
1 1 0 0 0 1 0 0 1
1 1 0 0 0 0 0 0 0
1 0 0 1 0 0 0 0 0
1 0 0 0 1 0 0 0 0
1 0 0 0 0 1 0 0 0
1 0 0 0 0 0 0 0 0
(this DM is appropriate if you ultimately want to test an additive model - a model where estimates between the age classes parallel each other on the logit scale). Column 1 is the intercept, column 2 is age class, columns 3 -> 6 are time code, and columns 7 -> 9 are the interactions of age and time. Pay attention to the fact that there is no adult age class for the first interval, which is why there is no interaction column for that interval.
or (if you don't care about additive models...)
1 1 0 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0
1 0 0 1 0 0 0 0 0
1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 0 0
0 0 0 0 0 1 1 0 0
0 0 0 0 0 1 0 1 0
0 0 0 0 0 1 0 0 1
0 0 0 0 0 1 0 0 0
This is the interaction model, but since each age class has a unique intercept, you can't build an additive model. But, you may or may note want to. The key is that both DM's have the same number of columns (and are entirely equivalent in terms of the real parameter estimates MARK will report).
If you use PIMs, the default is the sin link. If you use a DM approach, the link function is a logit link. This difference should not affect the deviance, but may affect the number of estimated paramteres. This is discussed in some detail in the book - read chapters 7 and 8, carefully.