R code for "Live fast, die old: no evidence of reproductive senescence or costs of mating in a damselfly (Odonata: Zygoptera)"
Source publication: Hassall, C., Watts, P.C., Sherratt, T.N., Thompson, D.J. (2015) Live fast, die old: no evidence of reproductive senescence or costs of mating in a damselfly (Odonata: Zygoptera), Jounal of Animal Ecology.
These R scripts contain the backbone of the code used in the analysis for the paper. The data are presented in a simplified form elsewhere on Figshare, and so the code cannot be run directly. However, linking the methods in the paper with the code here and the data on Figshare will enable the reader to replicate the analysis. There are four groups of analysis, as outlined in the published paper:
1) The first deals with a simplified "cohort" analysis, where capture histories are pooled for animals of particular ages. We then calculate the numbers mating or not mating on each day and use a binomial mixed effects model to investigate age-related patterns. The data for this analysis are available ready for analysis in R from Figshare.
2) A simple analysis using RMark to look for an effect of breeding stratum on survival, resighting, and transition probability. This can be seen below. As with 1), some data processing is required to obtain the chdata format required by RMark. Details can be found on the RMark website: http://www.phidot.org/software/mark/rmark/.
3) An extension of 2) demonstrating the best fit of time, age, and stratum in each of the models.
4) An extention of 3) adding climate (as time-varying covariates) and mites (as individual covariates) to the models.
Associated data are also available (see link in manuscript).