Ages in RMark interface to MARK

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

Ages in RMark interface to MARK

Postby JeffHostetler » Tue Sep 23, 2008 10:40 am

This is something that might be obvious to others, but wasn’t to me. If you’re starting individuals out at different ages by using the incredibly useful initial.ages parameter of the process.data function, you should make sure all starting ages are actually represented in your data, or you may have some unintended consequences. This is particularly relevant if you’re bootstrapping your own dataset, as individual bootstrapped datasets may be missing particular starting ages.

If both the levels of the starting age factor and the initial.ages vector contain the missing age, then you won’t get any error messages, but the ages after that will be assigned incorrectly. For example, if age 1 is missing, then age 0 will be assigned age 0, age 2 will be assigned age 1, age 3 will be assigned age 2, etc.

If both the levels of the starting age factor and the initial.ages vector skip the missing age(s), then there seem to be no problems. Here is one way to make sure this is the case:

Code: Select all
bootData1$StartAge=as.factor(as.integer(bootData1$StartAge))
init.ages=as.integer(levels(bootData1$StartAge))
kit.boot.process = process.data(bootData1, model="Burnham", groups=c("Sex",  "StartAge"), age.var=2, initial.ages=init.ages)


Hope this helps someone,

Jeff
JeffHostetler
 
Posts: 13
Joined: Thu Sep 18, 2008 11:31 am
Location: Smithsonian Institution

Ages in RMark

Postby jlaake » Mon Sep 29, 2008 2:16 pm

Jeff makes a good point here and his solution should work. The key to remember is that the ages are assigned from initial.ages in order of the levels of the factor variable. Also, the default is to exclude any groups that have no capture histories. That can be controlled by setting allgroups=TRUE (FALSE is default) but then you'll have to deal with setting parameters that have no data for those groups. Another related point is that factor levels are sorted alphanumerically. So let's say the factor levels were pup(0), yearling (1), and adult(2+). The levels of the factor variable would be ordered as adult, pup,yearling so that initial.ages would be set as 2,0,1.

I'll look at the process.data code to see if I can't trap for this potential unsuspecting error.

regards --jeff
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA


Return to RMark

Who is online

Users browsing this forum: No registered users and 13 guests