Diagonals for 3 age class, 2 sex CJS model
Posted: Thu Jan 11, 2018 2:20 pm
I am relatively new to RMark, so this may be dumb. I trying to convert a CJS analysis I do every year to RMark; there are 3 age classes, captured as subad yr1, subad yr2, and ad. Below is my code. My problem is that I'm getting pims for the sub2, which need 2 diags, that look like:
group = ageS1.sexF
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1 27 28 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
2 29 30 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
3 31 32 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
4 33 34 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
5 35 36 7
I want the 28 to be below the 27 on the first year diagonal, and then the second year diagonal to start at 53.
I alos want my second diagonal for S1 to match the first (and only) diag for S2. Can I do this with bins? Thanks for your help. Mary
*****************************************
SIEallowls1990_2016cjs=convert.inp("SIEallowls1990_2016cjs",
group.df=data.frame(age=c("S1","S1","S2","S2","A","A"),sex=c("M","F","M","F","M","F")))
#Data are resorted by grps in alphabet order, so AF,AM,S1F,S2F,S1M,S2M is RMARK order
SIEallowls1990_2016cjs.process=process.data(SIEallowls1990_2016cjs,groups=c("age","sex"),initial.ages=c(2,0,1))
SIEallowls1990_2016cjs.ddl=make.design.data(SIEallowls1990_2016cjs.process)
# Setting the bins here key, 0=start for juvies,1-26=adults - tricky for 3 grps
SIEallowls1990_2016cjs.ddl=add.design.data(SIEallowls1990_2016cjs.process,SIEallowls1990_2016cjs.ddl,"Phi","age",
bins=c(0,1,2,27),
right=FALSE,name="age",replace = T)
group = ageS1.sexF
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1 27 28 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
2 29 30 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
3 31 32 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
4 33 34 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
5 35 36 7
I want the 28 to be below the 27 on the first year diagonal, and then the second year diagonal to start at 53.
I alos want my second diagonal for S1 to match the first (and only) diag for S2. Can I do this with bins? Thanks for your help. Mary
*****************************************
SIEallowls1990_2016cjs=convert.inp("SIEallowls1990_2016cjs",
group.df=data.frame(age=c("S1","S1","S2","S2","A","A"),sex=c("M","F","M","F","M","F")))
#Data are resorted by grps in alphabet order, so AF,AM,S1F,S2F,S1M,S2M is RMARK order
SIEallowls1990_2016cjs.process=process.data(SIEallowls1990_2016cjs,groups=c("age","sex"),initial.ages=c(2,0,1))
SIEallowls1990_2016cjs.ddl=make.design.data(SIEallowls1990_2016cjs.process)
# Setting the bins here key, 0=start for juvies,1-26=adults - tricky for 3 grps
SIEallowls1990_2016cjs.ddl=add.design.data(SIEallowls1990_2016cjs.process,SIEallowls1990_2016cjs.ddl,"Phi","age",
bins=c(0,1,2,27),
right=FALSE,name="age",replace = T)