Creating age classes

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

Creating age classes

Postby PPalencia » Wed Jun 29, 2022 11:36 am

Dear,

I'm running a CJS analysis
I would like to reclassify my age variable, and create 3 age classes:
chicks 0-1 years (<1)
juveniles: 1-2 (>=1 <2)
adults: 2-... (>=2)


I realise that if I coded:
Code: Select all
dipper.ddl <- add.design.data(dipper.proc,
                              dipper.ddl,
                              "Phi",
                              type = "age",
                              bins = c(0, 1, 2, 7),
                              name = "ageclass",
                              replace=T)

It seems that for column "age" == 0 and "age" == 1, both are included in the category [0, 1]; which it is not my purpose:
Code: Select all
head(dipper.ddl)
$Phi
   par.index model.index group cohort age time occ.cohort Cohort Age Time sex ageclass
1          1           1     F      1   0    1          1      0   0    0   F    [0,1]
2          2           2     F      1   1    2          1      0   1    1   F    [0,1]
3          3           3     F      1   2    3          1      0   2    2   F    (1,2]
4          4           4     F      1   3    4          1      0   3    3   F    (2,7]


So, maybe should I code?:
Code: Select all
dipper.ddl <- add.design.data(dipper.proc,
                              dipper.ddl,
                              "Phi",
                              type = "age",
                              bins = c(0, 0.9, 1.9, 7),
                              name = "ageclass",
                              replace=T)


And now "age" == 0, is classified in one category, "age" == 1 in another different category, and "age" >= 2 in another different one category:

Code: Select all
head(dipper.ddl)
$Phi
   par.index model.index group cohort age time occ.cohort Cohort Age Time sex ageclass
1          1           1     F      1   0    1          1      0   0    0   F   [0,0.9]
2          2           2     F      1   1    2          1      0   1    1   F  (0.9,1.9]
3          3           3     F      1   2    3          1      0   2    2   F   (1.9,7]
4          4           4     F      1   3    4          1      0   3    3   F   (1.9,7]


Please, can you confirm me which coding I have to use for reclassifying the data according to my ecological preferences?
I have seen in some demos/vignettes option 1, but I think that this is not correct...

Additionally, I would like to ask how the number of parameters (npar) is estimated in Rmark

Thanks a lot
Pablo
PPalencia
 
Posts: 4
Joined: Tue Jun 21, 2022 4:13 am

Re: Creating age classes

Postby jlaake » Wed Jun 29, 2022 6:24 pm

I don't have the documentation in front of me but I believe there is an argument right which you can set to FALSE to stop it from including the right end point, but what you did in second approach looks fine. Also you don't need to use add.design.data. You can use any R statements to add or modify design data like the cut function which add.design.data used.

RMark assumes the design matrix is full rank, so it uses the number of columns in the design matrix as the parameter count. Again there is an argument you can set if you prefer to use the parameter count that MARK computes.

Have you read the workshop notes? The link to it is given the every time, you enter library (RMark) in a new R session.

Jeff
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Creating age classes

Postby PPalencia » Thu Jun 30, 2022 7:08 am

Thanks a lot Jeff

Yes, I'm working with the workshop notes
PPalencia
 
Posts: 4
Joined: Tue Jun 21, 2022 4:13 am


Return to RMark

Who is online

Users browsing this forum: No registered users and 17 guests