Page 1 of 1

Re: Robust Design and Ages

PostPosted: Tue Nov 17, 2020 1:31 pm
by Bill Kendall
This is a solvable problem, but it depends on what age is meant to predict. If it's survival or temporary emigration, then you would do it the same way that you saw with the CJS model (2 groups: first captured as juvenile and first captured as adults). The first diagonal of the PIM for the young would be unique, but the rest of the PIM would match with the PIM for the adults (see chapter 7 of the book). The first diagonal applies to the first survival (primary period) interval after initial capture. After that initial interval the individual is now an adult, and therefore parameters for that group match with the group for released as adult.

If you want to model detection probability as a function of age, then I believe you could do it with a time-varying individual covariate on p/c (e.g., a 1 for the primary period when they are juveniles to offset them from adults, and a 0 when they are adults). Alternatively, you could do the entire analysis using the multistate robust design model, defining a juvenile state and an adult state. Those that start off as juveniles transition to adults with probability 1.0. If you also have temporary emigration (unobservable states), then your state structure would be more complicated but still doable.

Re: Robust Design and Ages

PostPosted: Tue Nov 17, 2020 3:41 pm
by jln1234
Thanks for getting back to me!
I have a few follow-up questions and aspects I would like clarified just to make sure I understand. The age would be to look at survival. So going back and reading through chapter 7, I would organize my encounter history with individuals who were first marked as juveniles or first marked as adults. So the encounter history would look like
Code: Select all
100100001111111111 A Bla B Perm. F
or
Code: Select all
100100001111111111 J Bla B Perm. F

or with A representing adult and J representing juvenile. Or would it be best to have that in 1s and 0s? My next question is how do I actually incorporate that into the robust design in RMark? Looking at the Crmark section in the gentle introduction it looks like I would make it a design covariate then use add.design.data? The example uses bins? Would I then create bin 1 and 2 ( one for adult and the other for juveniles). If that is the way to do that in Rmark how does that tie into creating the PIM tables from chapter 7. I apologize for the bombardment of questions and clarifications.

Re: Robust Design and Ages

PostPosted: Tue Nov 17, 2020 3:47 pm
by egc
A thread in another subforum (viewtopic.php?f=34&t=4093) was transitioning to an RMark-specific question, so I moved the relevant bits here.

Re: Robust Design and Ages

PostPosted: Tue Nov 17, 2020 9:09 pm
by jlaake
Use your age covariate in the groups argument and use age.var to assign which of the group variables is the age variable and assign initial.ages for the age categories in factor level order - A and then J. With this information it will add an age variable to the design data for primary parameters. Please read the workshop notes. The link is given when you type library(RMark).

Re: Robust Design and Ages

PostPosted: Thu Nov 19, 2020 12:30 pm
by jlaake
Here is an example using the ?robust data in the package. I used the default name age so I didn't need to use age.var. Notice how there is an age variable for S but not p because the assumption is that time between occasions is 0 so age should not change during the session. Also, there is no equivalent to cohort but as Bill said you could use a time varying individual covariate if you so choose.

Code: Select all
> data(robust)
> robust$age=factor(c(rep("A",334),rep("J",334)))
> rd=process.data(robust,model="Robust",groups="age",initial.ages=c(1,0),time.intervals=time.intervals)
> ddl=make.design.data(rd)
> ddl$S
   par.index model.index group cohort age time occ.cohort Cohort Age Time initial.age.class
1          1           1     A      1   1    1          1      0   1    0                 A
2          2           2     A      1   2    2          1      0   2    1                 A
3          3           3     A      1   3    3          1      0   3    2                 A
4          4           4     A      1   4    4          1      0   4    3                 A
5          5           5     A      2   1    2          2      1   1    1                 A
6          6           6     A      2   2    3          2      1   2    2                 A
7          7           7     A      2   3    4          2      1   3    3                 A
8          8           8     A      3   1    3          3      2   1    2                 A
9          9           9     A      3   2    4          3      2   2    3                 A
10        10          10     A      4   1    4          4      3   1    3                 A
11        11          11     J      1   0    1          1      0   0    0                 J
12        12          12     J      1   1    2          1      0   1    1                 J
13        13          13     J      1   2    3          1      0   2    2                 J
14        14          14     J      1   3    4          1      0   3    3                 J
15        15          15     J      2   0    2          2      1   0    1                 J
16        16          16     J      2   1    3          2      1   1    2                 J
17        17          17     J      2   2    4          2      1   2    3                 J
18        18          18     J      3   0    3          3      2   0    2                 J
19        19          19     J      3   1    4          3      2   1    3                 J
20        20          20     J      4   0    4          4      3   0    3                 J
> ddl$p
   par.index model.index group time session Time initial.age.class c
1          1          53     A    1       1    0                 A 0
2          2          54     A    2       1    1                 A 0
3          3          55     A    1       2    0                 A 0
4          4          56     A    2       2    1                 A 0
5          5          57     A    1       3    0                 A 0
6          6          58     A    2       3    1                 A 0
7          7          59     A    3       3    2                 A 0
8          8          60     A    4       3    3                 A 0
9          9          61     A    1       4    0                 A 0
10        10          62     A    2       4    1                 A 0
11        11          63     A    3       4    2                 A 0
12        12          64     A    4       4    3                 A 0
13        13          65     A    5       4    4                 A 0
14        14          66     A    1       5    0                 A 0
15        15          67     A    2       5    1                 A 0
16        16          68     J    1       1    0                 J 0
17        17          69     J    2       1    1                 J 0
18        18          70     J    1       2    0                 J 0
19        19          71     J    2       2    1                 J 0
20        20          72     J    1       3    0                 J 0
21        21          73     J    2       3    1                 J 0
22        22          74     J    3       3    2                 J 0
23        23          75     J    4       3    3                 J 0
24        24          76     J    1       4    0                 J 0
25        25          77     J    2       4    1                 J 0
26        26          78     J    3       4    2                 J 0
27        27          79     J    4       4    3                 J 0
28        28          80     J    5       4    4                 J 0
29        29          81     J    1       5    0                 J 0
30        30          82     J    2       5    1                 J 0
>

Re: Robust Design and Ages

PostPosted: Thu Nov 19, 2020 12:33 pm
by jlaake
One final note. Notice the difference between initial.age.class which doesn't change through time and age which does change for S. This is a common mistake and one the path you were headed in your original suggestion to add to the ddl. The only way you get the PIM structure Bill mentioned is if you have a changing age through time. To see the difference create a model using ~age and another with ~initial.age.class and look at the PIMS.