Mariana Mira wrote:I am trying to construct a design matrix with survival constant in time with only a transient effect in survival. I have read the Mark documentation and I just found how to contruct a design matrix with age effect varying with time. I tryed to construct a design matrix, but the result is not the same as using PIM, so I think that I did something wrong. My design matrix gives the same result as with sex effect (males and females) and not with only transient effect (with no sex effect). Can anybody help me? My PIM for survival look like this for males and females:
1222222
122222
12222
1222
122
12
1
There are at least 2 ways you could approach this problem. But, I'll describe the most flexible. For purposes of this example, assume two groups (say, males and females), with 5 encounter occasions. A priori, we'll assume there is potential for time-variation in phi. We'll assume no variation in p between groups or over time. Assume also we suspect the possibility of 'transients' in the marked samples. So, our PIMS would look like - for males (assume males are the first group in the INP file)
- Code: Select all
1 5 6 7
2 6 7
3 7
4
and for females
- Code: Select all
8 12 13 14
9 13 14
10 14
11
Now, the DM corresponding to these PIMs is a bit tricky, but not too bad if you take your time, and pay attention. First, you write out the linear model as
phi = int + sex + age + time + sex*age + sex*time + age*time + sex*age*time.
Next, you need to notice that not all time intervals apply to all TSM classes in the model (discussed in detail in Chapter 8). I've added some blank columns to make the sections more obvious.
- Code: Select all
1 1 1 1 0 0 1 0 0 1 0 0 0 0 0
1 1 1 0 1 0 1 1 0 0 1 0 1 0 0
1 1 1 0 0 1 1 0 1 0 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 0 0 1 0 0 0 0
1 1 0 0 0 1 0 0 0 0 0 1 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 1 0 0 0 0 0 0 0
1 0 1 0 0 1 0 0 1 0 0 0 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
Column 1 is the intercept, column two codes for sex, column three age (where 1's indicate first TSM class), columns 4-6 time intervals (pay attention to the coding here), column 7 is the S*A interaction, columns 8-9 are the A*time interactions (again, pay attention to which intervals actually have an interaction with age - see Chapter 8), columns 10-12 are the S*time interactions, columns 13-14 are the A*S*time interactions, and column 15 is the encounter rate.
Now, this is a pretty general model, and you can reduce it in a straightforward manner simply be deleting columns. For example, in your original note, you said you wanted constant over time within each TSM class, but different between groups. Easy, simply delete the time columns from the DM, and any interaction columns involving time:
- Code: Select all
1 1 1 1 0
1 1 1 1 0
1 1 1 1 0
1 1 1 1 0
1 1 0 0 0
1 1 0 0 0
1 1 0 0 0
1 0 1 0 0
1 0 1 0 0
1 0 1 0 0
1 0 1 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
0 0 0 0 1
This DM constrains your time-dependent PIMS to be entirely equivalent to
- Code: Select all
1 2 2 2
1 2 2
1 2
1
and for females
- Code: Select all
3 4 4 4
3 4 4
3 4
3
In general, I suggest building the DM for a general, time-dependent model first, then constraining it (i.e., build reduced parameter models) byy adding/deleting/changing columns in this DM. A bit more work up front, but generally worth it in the end.
If you really want the DM corresponding to the time-constant PIMS, for this example it would look like
- Code: Select all
1 1 1 1 0
1 1 0 0 0
1 0 1 0 0
1 0 0 0 0
0 0 0 0 1
Have another read through both Chapter 7, and Chapter 8. All the preceding is discussed in both chapters, implicitly if not explicitly.