# Data from: Early-life variation in migration is subject to strong fluctuating survival selection in a partially migratory bird

## Cite this dataset

Ugland, Cassandra R. et al. (2024). Data from: Early-life variation in migration is subject to strong fluctuating survival selection in a partially migratory bird [Dataset]. Dryad. https://doi.org/10.5061/dryad.r4xgxd2mf

## Abstract

Population dynamic and eco-evolutionary responses to environmental variation and change fundamentally depend on combinations of within- and among-cohort variation in phenotypic expression of key life-history traits, and on corresponding variation in selection on those traits. Specifically, in partially migratory populations, spatio-seasonal dynamics depend on the degree of adaptive phenotypic expression of seasonal migration versus residence, where more individuals migrate when selection favours migration.

Opportunity for adaptive (or, conversely, maladaptive) expression could be particularly substantial in early life, through initial development of migration versus residence. However, within- and among-cohort dynamics of early-life migration, and of associated survival selection, have not been quantified in any system, preventing any inference on adaptive early-life expression. Such analyses have been precluded because data on seasonal movements and survival of sufficient young individuals, across multiple cohorts, have not been collected.

We undertook extensive year-round field resightings of 9,359 colour-ringed juvenile European Shags (*Gulosus aristotelis*) from 11 successive cohorts in a partially-migratory population. We fitted advanced Bayesian multi-state capture-mark-recapture models to quantify early-life variation in migration versus residence and associated survival across short temporal occasions through each cohort’s first year from fledging, thereby quantifying the degree of adaptive phenotypic expression of migration within and across years.

All cohorts were highly partially migratory, but the degree and timing of migration varied considerably within and among cohorts. Episodes of strong survival selection on migration versus residence occurred both on short timeframes within years, and cumulatively across whole years, generating instances of instantaneous and cumulative net selection that would be obscured at coarser temporal resolutions. Further, the magnitude and direction of selection varied among years, generating strong fluctuating survival selection on early-life migration across cohorts, as rarely evidenced in nature. Yet, the degree of migration did not strongly covary with the direction of selection, indicating limited early-life adaptive phenotypic expression.

These results reveal how dynamic early-life expression and selection on a key life-history trait, seasonal migration, can emerge across seasonal, annual, and multi-year timeframes, yet be substantially decoupled. This restricts the potential for adaptive phenotypic, micro-evolutionary, and population dynamic responses to changing seasonal environments.

## README: Data from: Within- and among-cohort variation in early-life migration is subject to strong fluctuating survival selection in a partially migratory bird

https://doi.org/10.5061/dryad.r4xgxd2mf

The data comprises summaries of field observations required to reproduce the analyses presented in the manuscript: Within- and among-cohort variation in early-life migration is subject to strong fluctuating survival selection in a partially migratory bird. Associated R and STAN code are also provided.

Authors: Cassandra R. Ugland, Paul Acker, Sarah J. Burthe, Rita Fortuna, Carrie Gunn, Thomas R. Haaland, Michael P. Harris, Timothy I. Morley, Mark A. Newell, Robert L. Swann, Sarah Wanless, Francis Daunt, and Jane M. Reid

January 2024

Study population: A population of European shags (*Gulosus aristotelis*) breeding on Isle of May National Nature Reserve (hereafter ‘IoM’), Scotland (56°11'5.40"N, 2°33'16.19"W).

Files are summarised below

R scripts are annotated to explain steps and definitions of all variables

Code was written and used with R v4.2.1 and STAN v2.21.0

### Description of the data and file structure

Here we include two R scripts, two STAN model scripts, 11 excel files with the capture-recapture histories for each of the 11 cohorts (“crh2010.xlsx” … “crh2020.xlsx”), as well as several excel files with all the estimated parameters used to generate the figures in the main manuscript. Below we describe the steps required to run both R scripts and explain the corresponding input and output objects.

First, the R script “RunModelScript.R” is used to run the two STAN files “CJS4StateModel.stan” and “2011_CJS4StateModel.stan” using the input files “crh2010.xlsx” … “crh2020.xlsx”.

The input files contain cohort-specific capture-recapture histories for the 11 cohorts described in the main manuscript. Each row in each file corresponds to an individual first-year shag ringed on IoM in the year of the file name, e.g., “crh2010.xlsx” contains 1101 individuals hatched and ringed on IoM in 2010. The 12 columns V1 … V12 are the 12 occasions detailed in the main manuscript, and the values 1-4 correspond to the state in which an individual was observed (1: resident state, 2: migrant 1 state, 3: migrant 2 state, and 4: unobserved).

These input files are then used individually to run each cohort as a separate model. Cohorts 2010 and 2012-2020 are run in the same model called “CJS4StateModel.stan”, while the 2011 cohort is run using the “2011_CJS4StateModel.stan” model file due to differences in surveying intensity for the 2011 cohort. Each cohort is run separately by changing the variable ‘cohort’ to the desired year in the R script.

The main STAN model “CJS4StateModel.stan” has detailed comments describing the steps and variables within the model. The 2011 cohort-specific model “2011_CJS4StateModel.stan” is only commented with the differences between it and the main model for simplicity.

Running this code for each of the 11 cohorts will generate 11 output files named out2020 … out2020 to be saved and used as input for the second R script “DerivedParameters.R”.

The R script “DerivedParameters.R” uses the STAN output objects created above to generate the derived parameters that are not coded into the STAN models. As above, each of the 11 cohorts needs to be run separately by changing the variable ‘cohort’ to the desired year in the ‘Individual Cohort’ section of the R script. This will generate results tables for the key parameters of interest from the model and are described below.

- surv = the posterior means of the probability of resident and migrant survival for each of the relevant intervals (as described in the main manuscript)
- diff = the posterior means of the survival difference between migrant and resident survival for each relevant interval
- epsilon = the posterior means of the probability of departing from the resident state for each relevant interval
- omega = the posterior means of the probability of returning to the resident state for each relevant interval
- migfrac = the posterior means of the migratory fraction for each relevant interval
- prop = the posterior means of the proportion of survival difference estimates above zero
- ep = the posterior estimates of epsilon for each relevant interval
- om = the posterior estimates of omega for each relevant interval
- mf = the posterior estimates of the migratory fraction for each relevant interval
- phir = the posterior estimates of resident survival for each relevant interval
- phim = the posterior estimates of migrant survival for each relevant interval
- Year = the posterior estimates of the annual survival probabilities for the five focal tactics (as described in the main manuscript)
- tau = the posterior mean of the annual survival difference between early migrants and full residents
- taut = the posterior estimates of the annual survival difference between early migrants and full residents

These results are generated for each cohort and combined to create the following dataframes.

- epsilon20xx = epsilon estimates for all relevant intervals, for all cohorts
- omega20xx = omega estimates for all relevant intervals, for all cohorts
- migfrac20xx = migratory fraction estimates for all relevant intervals, for all cohorts
- eplxx = posterior estimates of epsilon for all relevant intervals, for all cohorts
- omlxx = posterior estimates of omega for all relevant intervals, for all cohorts
- mflxx = posterior estimates of the migratory fractions for all relevant intervals, for all cohorts
- diff20xx = survival difference estimates for all relevant intervals, for all cohorts
- surv20xx = survival estimates for all relevant intervals, for all cohorts
- prop20xx = proportion of survival differences above 0 estimates for all relevant intervals, for all cohorts
- phirxx = posterior estimates of resident survival for all relevant intervals, for all cohorts
- phimxx = posterior estimates of migrant survival for all relevant intervals, for all cohorts
- Year20xx = annual survival estimates for the five tactics, for all cohorts
- tau20xx = annual survival differences for all cohorts
- tautxx = posterior estimates of annual survival differences for all cohorts

Subsequently, after combining all the above results the following derived parameters can be estimated.

- epmfin = the grand mean of departing from the resident state across all cohorts for all relevant intervals
- epvfin = the grand variance of departing from the resident state across all cohorts for all relevant intervals
- ommfin = the grand mean of returning to the resident state across all cohorts for all relevant intervals
- omvfin = the grand variance of returning to the resident state across all cohorts for all relevant intervals
- mfmfin = the grand mean of the migratory fraction across all cohorts for all relevant intervals
- mfvfin = the grand variance of the migratory fraction across all cohorts for all relevant intervals
- phirmfin = the grand mean of resident survival across all cohorts for all relevant intervals
- phirvfin = the grand variance of resident survival across all cohorts for all relevant intervals
- phimmfin = the grand mean of migrant survival across all cohorts for all relevant intervals
- phimvfin = the grand variance of migrant survival across all cohorts for all relevant intervals
- epmfin_scaled = the scaled grand mean of returning to the resident state across all cohorts for all relevant intervals
- ommfin_scaled = the scaled grand mean of departing from the resident state across all cohorts for all relevant intervals
- phirmfin_scaled = the scaled grand mean of resident survival across all cohorts for all relevant intervals
- phimmfin_scaled = the scaled grand mean of migrant survival across all cohorts for all relevant intervals
- results.test = the linear regression slope and intercept of the covariance between mid-winter migratory fraction and annual survival difference across all cohorts

Finally, we have compiled several excel files with the above estimates used to generate the figures in the main manuscript. These files contain various estimates for the key parameters estimated in the model or as derived parameters.

- “Epsilon_PM.xlsx” provides posterior means and 95% credible intervals (95%CIs) for all cohorts for all relevant intervals for the probability of departing from the resident state.
- “Epsilon_GMV.xlsx” provides grand means and 95%CIs, grand variances and 95%CIs, and scaled grand means and 95%CIs, for all cohorts for all relevant intervals for the probability of departing from the resident state.
- “Omega_PM.xlsx” provides posterior means and 95%CIs for all cohorts for all relevant intervals for the probability of returning to the resident state.
- “Omega_GMV.xlsx” provides grand means and 95%CIs, grand variances and 95%CIs, and scaled grand means and 95%CIs, for all cohorts for all relevant intervals for the probability of returning to the resident state.
- “MigFrac_PM.xlsx” provides posterior means and 95%CIs for all cohorts for all relevant intervals for the migratory fraction.
- “MigFrac_GMV.xlsx” provides grand means and 95%CIs, and grand variances and 95%CIs, for all cohorts for all relevant intervals for the migratory fraction.
- “phiR_PM.xlsx” provides posterior means and 95%CIs for all cohorts for all relevant intervals for the probability surviving as a resident.
- “phiR_GMV.xlsx” provides grand means and 95%CIs, grand variances and 95%CIs, and scaled grand means and 95%CIs, for all cohorts for all relevant intervals for the probability surviving as a resident.
- “phiM_PM.xlsx” provides posterior means and 95%CIs for all cohorts for all relevant intervals for the probability surviving as a migrant.
- “phiM_GMV.xlsx” provides grand means and 95%CIs, grand variances and 95%CIs, and scaled grand means and 95%CIs, for all cohorts for all relevant intervals for the probability surviving as a migrant.
- “Diff_PM.xlsx” provides posterior means and 95%CIs for all cohorts for all relevant intervals for the interval-specific survival difference.
- “Prop.xlsx” provides the proportions of survival difference posterior estimates above 0 for all cohorts for all relevant intervals.
- “AnnSurv_PM.xlsx” provides the posterior means and 95%CIs for the five annual survival tactics for all cohorts.
- “AnnSurvCJSMARK_PM.xlsx” provides the means and 95% confidence intervals for the annual survival estimates from the 3-occasion CJS model and the MARK model for all cohorts.
- “AnnDiff_PM.xlsx” provides the posterior means and 95%CIs for the annual survival differences for all cohorts.
- “WinterMigFrac_PM.xlsx” provides the posterior means and 95%CIs for the mid-winter migratory fraction for all cohorts.

### Code/Software

See above for summary of the R script and STAN files linked to each set of data files.

## Methods

The data come from a long-term study of European shags (*Gulosus aristotelis*) breeding the Isle of May National Nature Reserve, Scotland (56°11'5.40"N, 2°33'16.19"W). The data comprise capture-recapture history data derived from field-ring-resighting data from 11 cohorts of first-year juveniles between 2010 and 2020. Codes for bespoke multi-state capture-mark-recapture models are provided.

## Funding

The Research Council of Norway, Award: 223257

Natural Environment Research Council, Award: NE/M005186/1

Natural Environment Research Council, Award: NE/R000859/1

Natural Environment Research Council, Award: NE/R016429/1

The Research Council of Norway, Award: 313570