DOI: 10.5061/dryad.1c59zw481
title: Data from: Early-life stasis in partial seasonal migration is underpinned by among-cohort variation in migratory plasticity and selective disappearance

description: Life-history traits expressed through early life may exhibit considerable
 among-cohort variation, affecting population age-structure and resulting
 dynamics. Yet, initial among-cohort variation could be substantially
 reshaped by dynamic combinations of labile plasticity and selective
 disappearance acting within and among cohorts across years and ages.
 However, such dynamics are rarely quantified for any trait, impeding the
 prediction of phenotypic outcomes. We quantified overall early-life
 phenotypic stasis versus change, and underlying dynamics of plasticity and
 selection, for the key life-history trait of seasonal migration versus
 residence by fitting multi-state models to multi-year ring-resighting data
 from 11 cohorts of partially migratory European shags (Gulosus
 aristotelis). Although the cross-cohort proportion of migrants remained
 approximately constant across the four years following fledging, there was
 a selective disappearance of sub-adult residents balanced by net
 plasticity towards residence. However, these cross-cohort means obscured
 substantial among-cohort variation in initial partial migration, and in
 the subsequent effects of both plasticity and selective disappearance.
 Here, plasticity reinforced versus counteracted selection at different
 times, thereby reshaping the pattern of among-cohort variation in partial
 migration across ages. These results show that early-life plasticity and
 selection are both highly changeable, causing dynamic cross-age cohort
 effects in a key life-history trait, yet preventing cross-cohort
 age-specific phenotypic change.
description: The data come from a long-term study of European shags
 (<em>Gulosus aristotelis</em>) 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 sub-adult
 individuals fledged on the Isle of May between 2010 and 2020. Codes for
 bespoke multi-state capture-mark-recapture models are provided. 
description: # Data from: Early-life stasis in partial seasonal migration is
 underpinned by among-cohort variation in migratory plasticity and
 selective disappearance The data comprises summaries of field observation
 data required to reproduce the analyses presented in the manuscript: 
 Early-life stasis in partial seasonal migration is underpinned by
 among-cohort variation in migratory plasticity and selective
 disappearance. Study population: European shags (*Gulosus aristotelis*)
 breeding on the 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 version 4.3.2 and STAN v2.32.5 ##
 Description of the data and file structure Here we include two R scripts
 and one STAN model script, 1 excel file with the capture-mark-recapture
 histories for all 11 cohorts (2010...2020), in addition to several excel
 files with the estimated parameters required to generate figures in the
 main manuscript. Below we describe the steps required to run both R
 scripts and explain the corresponding input and output objects. ## Running
 R and STAN scripts First, the R script “RunModelScript.R” is used to run
 the STAN file “CJS4SM.stan” using the input files “crh_allyrs.xlsx”. The
 input file "crh_allyrs.xlsx" contains cohort-specific
 capture-recapture histories for the 11 cohorts described in the main
 manuscript. Each row in each file corresponds to an individual shag
 (denoted in the column "BirdID") ringed on IoM in the year
 denoted in the column "HatchYear". The 6 columns V1 … V6 are the
 6 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). This input file
 is then used to run each cohort individually as a separate model using the
 file "RunModelScript.R" with the model "CJS4SM.stan",
 both of which are annotated with comments describing the steps and
 variables needed. Each cohort is run separately by changing the variable
 'cohort' to the desired year in the R script. Running this code
 for each of the 11 cohorts generates 11 output files named
 "out2010.rds"..."out.2020.rds" and are used as input
 files 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.
 This will generate results tables for the key parameters of interest from
 the model and are described below. * values20xx = the posterior means and
 95% credible intervals directly estimated for each cohort model * ep = the
 posterior estimates of the probability of departing from the resident
 state for each relevant starting occasion * om = the posterior estimates
 of the probability of returning to the resident state for each relevant
 starting occasion * mf = the posterior estimates of the migratory fraction
 for each relevant starting occasion * nu = the posterior estimates of the
 repeatability for each relevant starting occasion * di = the posterior
 estimates of the survival difference between migrant and resident survival
 for each relevant starting occasion * phir = the posterior estimates of
 resident survival for each relevant starting occasion * phim = the
 posterior estimates of migrant survival for each relevant starting
 occasion These results are generated for each cohort and combined to
 create the following objects using all cohorts: * eplxx = posterior
 estimates of epsilon for all relevant starting occasions, for all cohorts
 * omlxx = posterior estimates of omega for all relevant starting
 occasions, for all cohorts * mflxx = posterior estimates of the migratory
 fractions for all relevant starting occasions, for all cohorts * nulxx =
 posterior estimates of the repeatability for all relevant starting
 occasions, for all cohorts * di20xx = survival difference estimates for
 all relevant starting occasions, for all cohorts * phirxx = posterior
 estimates of resident survival for all relevant starting occasions, for
 all cohorts * phimxx = posterior estimates of migrant survival for all
 relevant starting occasions, for all cohorts And excluding the 2012 and
 2013 cohorts, which suffered substantial mortality: * eplxx1213 =
 posterior estimates of epsilon for all relevant starting occasions, for
 cohorts 2010:2011 and 2014:2020 * omlxx1213 = posterior estimates of omega
 for all relevant starting occasions, for cohorts 2010:2011 and 2014:2020 *
 mflxx1213 = posterior estimates of the migratory fractions for all
 relevant starting occasions, for cohorts 2010:2011 and 2014:2020 *
 nulxx1213 = posterior estimates of the repeatability for all relevant
 starting occasions, for cohorts 2010:2011 and 2014:2020 * di20xx1213 =
 survival difference estimates for all relevant starting occasions, for
 cohorts 2010:2011 and 2014:2020 * phirxx1213 = posterior estimates of
 resident survival for all relevant starting occasions, for cohorts
 2010:2011 and 2014:2020 * phimxx1213 = posterior estimates of migrant
 survival for all relevant starting occasions, for cohorts 2010:2011 and
 2014:2020 ## Derived parameter objects Subsequently, after combining all
 the above results the following derived parameters with 95% credible
 intervals are be estimated with the 2012 and 2013 included: * epmfin = the
 grand mean of departing from the resident state (Epsilon) across all
 cohorts for all relevant starting occasions * epvfin = the grand variance
 of departing from the resident state (Epsilon) across all cohorts for all
 relevant starting occasions * ommfin = the grand mean of returning to the
 resident state (Omega) across all cohorts for all relevant starting
 occasions * omvfin = the grand variance of returning to the resident state
 (Omega) across all cohorts for all relevant starting occasions * mfmfin =
 the grand mean of the migratory fraction (m) across all cohorts for all
 relevant starting occasions * mfvfin = the grand variance of the migratory
 fraction (m) across all cohorts for all relevant starting occasions *
 numfin = the grand mean of the between winter repeatability (P[S]) across
 all cohorts for all relevant starting occasions * nuvfin = the grand
 variance of the between winter repeatability (P[S]) across all cohorts for
 all relevant starting occasions * dimfin = the grand mean of the survival
 difference (Delta[Phi]) across all cohorts for all relevant starting
 occasions * divfin = the grand variance of the survival difference
 (Delta[Phi]) across all cohorts for all relevant starting occasions *
 phirmfin = the grand mean of resident survival (Phi[R]) across all cohorts
 for all relevant starting occasions * phirvfin = the grand variance of
 resident survival (Phi[R]) across all cohorts for all relevant starting
 occasions * phimmfin = the grand mean of migrant survival (Phi[M]) across
 all cohorts for all relevant starting occasions * phimvfin = the grand
 variance of migrant survival (Phi[M]) across all cohorts for all relevant
 starting occasions * mdxx = posterior means of the migratory fraction
 difference (Delta[m]) for all relevant starting occasions, for all cohorts
 * probom1 = posterior means of the proportions of surviving migrants
 becoming residents (P[MR]) for all relevant starting occasions, for all
 cohorts * mfret = the grand mean of the proportions of surviving migrants
 becoming residents (P[MR]) across all cohorts for all relevant starting
 occasions * probep1 = posterior means of the proportions of surviving
 migrants becoming residents (P[RM]) for all relevant starting occasions,
 for all cohorts * mfdep = the grand mean of the proportions of surviving
 migrants becoming residents (P[RM]) across all cohorts for all relevant
 starting occasions * phi_bar = posterior estimates of the mean fitness
 (P[A]) for all relevant starting occasions, for all cohorts * m_sel =
 posterior estimates of the expected migratory fraction given no plasticity
 (m[sel]) for all relevant starting occasions, for all cohorts * s_diff =
 posterior estimates of the expected change in the migratory fraction given
 no plasticity (Delta[m.sel]) for all relevant starting occasions, for all
 cohorts * p_diff = posterior estimates of the expected change in the
 migratory fraction given no selection (Delta[m.pl]) for all relevant
 starting occasions, for all cohorts * mfexsurvdiff = posterior means of
 the expected change in the migratory fraction given no plasticity
 (Delta[m.sel]) for all relevant starting occasions, for all cohorts *
 mfexplasdiff = posterior means of the expected change in the migratory
 fraction given no selection (Delta[m.pl]) for all relevant starting
 occasions, for all cohorts * prop_spdiff = posterior estimates of
 proportions of Delta[m.sel] and Delta[m.pl] that have the same sign for
 all relevant starting occasions, for all cohorts * m_prop_spdiff =
 posterior means of proportions of Delta[m.sel] and Delta[m.pl] that have
 the same sign for all relevant starting occasions, for all cohorts *
 sp_diff = posterior estimates of the absolute difference between
 Delta[m.pl] and Delta[m.sel] for all relevant starting occasions, for all
 cohorts * msp_diff = posterior means of the absolute difference between
 Delta[m.pl] and Delta[m.sel] for all relevant starting occasions, for all
 cohorts * mspdiff = the grand mean of the absolute difference between
 Delta[m.pl] and Delta[m.sel] across all cohorts for all relevant starting
 occasions * covsp = the linear regression slope and intercept of the
 relationship between Delta[m.sel] and Delta[m.pl] for all relevant
 starting occasions, for all cohorts * cor_mf = Spearman's rank
 correlations of the relationship between initial migratory fraction (m)
 and subsequent migratory fractions (m) for all relevant starting
 occasions, for all cohorts * cor_ep = Spearman's rank correlations of
 the relationship between initial migratory fraction (m) and subsequent
 probabilities of departing from the resident state (Epsilon) for all
 relevant starting occasions, for all cohorts * cor_om = Spearman's
 rank correlations of the relationship between initial migratory fraction
 (m) and subsequent probabilities of returning to the resident state
 (Omega) for all relevant starting occasions, for all cohorts * cov11 = the
 linear regression slope and intercept of the relationship between initial
 migratory fraction (m) and subsequent probabilities of departing from the
 resident state (Epsilon) for all relevant starting occasions, for all
 cohorts * cov21 = the linear regression slope and intercept of the
 relationship between initial migratory fraction (m) and subsequent
 probabilities of returning to the resident state (Omega) for all relevant
 starting occasions, for all cohorts * cov31 = the linear regression slope
 and intercept of the relationship between initial migratory fraction (m)
 and subsequent migratory fractions (m) for all relevant starting
 occasions, for all cohorts And without the 2012 and 2013 cohorts included:
 * epmfin1213 = the grand mean of departing from the resident state
 (Epsilon) across cohorts 2010:2011 and 2014:2020 for all relevant starting
 occasions * epvfin1213 = the grand variance of departing from the resident
 state (Epsilon) across cohorts 2010:2011 and 2014:2020 for all relevant
 starting occasions * ommfin1213 = the grand mean of returning to the
 resident state (Omega) across cohorts 2010:2011 and 2014:2020 for all
 relevant starting occasions * omvfin1213 = the grand variance of returning
 to the resident state (Omega) across cohorts 2010:2011 and 2014:2020 for
 all relevant starting occasions * mfmfin1213 = the grand mean of the
 migratory fraction (m) across cohorts 2010:2011 and 2014:2020 for all
 relevant starting occasions * mfvfin1213 = the grand variance of the
 migratory fraction (m) across cohorts 2010:2011 and 2014:2020 for all
 relevant starting occasions * numfin1213 = the grand mean of the between
 winter repeatability (P[S]) across cohorts 2010:2011 and 2014:2020 for all
 relevant starting occasions * nuvfin1213 = the grand variance of the
 between winter repeatability (P[S]) across cohorts 2010:2011 and 2014:2020
 for all relevant starting occasions * dimfin1213 = the grand mean of the
 survival difference (Delta[Phi]) across cohorts 2010:2011 and 2014:2020
 for all relevant starting occasions * divfin1213 = the grand variance of
 the survival difference (Delta[Phi]) across cohorts 2010:2011 and
 2014:2020 for all relevant starting occasions * phirmfin1213 = the grand
 mean of resident survival (Phi[R]) across cohorts 2010:2011 and 2014:2020
 for all relevant starting occasions * phirvfin1213 = the grand variance of
 resident survival (Phi[R]) across cohorts 2010:2011 and 2014:2020 for all
 relevant starting occasions * phimmfin1213 = the grand mean of migrant
 survival (Phi[M]) across cohorts 2010:2011 and 2014:2020 for all relevant
 starting occasions * phimvfin1213 = the grand variance of migrant survival
 (Phi[M]) across cohorts 2010:2011 and 2014:2020 for all relevant starting
 occasions * mfret1213 = the grand mean of the proportions of surviving
 migrants becoming residents (P[MR]) across cohorts 2010:2011 and 2014:2020
 for all relevant starting occasions * mfdep1213 = the grand mean of the
 proportions of surviving residents becoming migrants (P[RM]) across
 cohorts 2010:2011 and 2014:2020 for all relevant starting occasions *
 covsp2 = the linear regression slope and intercept of the relationship
 between Delta[m.sel] and Delta[m.pl] across cohorts 2010:2011 and
 2014:2020 for all relevant starting occasions * cor_mf = Spearman's
 rank correlations of the relationship between initial migratory fraction
 (m) and subsequent migratory fractions (m) across cohorts 2010:2011 and
 2014:2020 for all relevant starting occasions * cor_ep = Spearman's
 rank correlations of the relationship between initial migratory fraction
 (m) and subsequent probabilities of departing from the resident state
 (Epsilon) across cohorts 2010:2011 and 2014:2020 for all relevant starting
 occasions * cor_om = Spearman's rank correlations of the relationship
 between initial migratory fraction (m) and subsequent probabilities of
 returning to the resident state (Omega) across cohorts 2010:2011 and
 2014:2020 for all relevant starting occasions * cov1 = the linear
 regression slope and intercept of the relationship between initial
 migratory fraction (m) and subsequent probabilities of departing from the
 resident state (Epsilon) across cohorts 2010:2011 and 2014:2020 for all
 relevant starting occasions * cov2 = the linear regression slope and
 intercept of the relationship between initial migratory fraction (m) and
 subsequent probabilities of returning to the resident state (Omega) across
 cohorts 2010:2011 and 2014:2020 for all relevant starting occasions * cov3
 = the linear regression slope and intercept of the relationship between
 initial migratory fraction (m) and subsequent migratory fractions (m)
 across cohorts 2010:2011 and 2014:2020 for all relevant starting occasions
 ## Excel files with estimates for figures 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
 and nuisance parameters estimated in the model or as derived parameters. *
 "Values_Final.xlsx" provides posterior means and 95% credible
 intervals for the key parameters of interest (Phi[R], Phi[M], Epsilon,
 Omega, m, Delta[Phi], P[S], P[RM], P[MR], Delta[m], Delta[m.sel],
 Delta[m.pl]) for all cohorts and relevant occasions and intervals *
 "epsilon_mean.xlsx" provides grand means and 95%CIs for all
 cohorts for all relevant intervals for the probability of departing from
 the resident state * "epsilon_variance.xlsx" provides grand
 variances and 95%CIs for all cohorts for all relevant intervals for the
 probability of departing from the resident state *
 "omega_mean.xlsx" provides grand means and 95%CIs for all
 cohorts for all relevant intervals for the probability of returning to the
 resident state * "omega_variance.xlsx" provides grand variances
 and 95%CIs for all cohorts for all relevant intervals for the probability
 of returning to the resident state * "mf_mean.xlsx" provides
 grand means and 95%CIs for all cohorts for all relevant occasions for the
 migratory fraction * "mf_variance.xlsx" provides grand variances
 and 95%CIs for all cohorts for all relevant occasions for the migratory
 fraction * "repeat_mean.xlsx" provides grand means and 95%CIs
 for all cohorts for all relevant intervals for the between winter
 repeatability * "repeat_variance.xlsx" provides grand variances
 and 95%CIs for all cohorts for all relevant intervals for the between
 winter repeatability * “d_mean.xlsx” provides grand means and 95%CIs for
 all cohorts for all relevant intervals for the survival differences
 between migrants and residents * “d_variance.xlsx” provides grand
 variances and 95%CIs for all cohorts for all relevant intervals for the
 survival differences between migrants and residents * “phir_mean.xlsx”
 provides grand means and 95%CIs for all cohorts for all relevant intervals
 for the probability surviving as a resident * “phir_variance.xlsx”
 provides grand variances and 95%CIs for all cohorts for all relevant
 intervals for the probability surviving as a resident * “phim_mean.xlsx”
 provides grand means and 95%CIs for all cohorts for all relevant intervals
 for the probability surviving as a migrant * “phim_variance.xlsx” provides
 grand variances and 95%CIs for all cohorts for all relevant intervals for
 the probability surviving as a migrant *
 "Detection_Estimates.xlsx" provides posterior means and 95%
 credible intervals for the detection parameters pR, pM1, and pM2 that
 correspond to detection in the resident, intensively surveyed migrant, and
 non-intensively surveyed migrant states for all cohorts for the focal
 occasions 2:5 * "Nuisance_Parameters.xlsx" provides posterior
 means and 95% credible intervals for the nuisance parameters delta and
 gamma (where delta represents the probability that an individual
 transitions to the M1 state condtional on departing the resident state,
 and gamma represents the probability of switching between either migrant
 state conditional on remaining migant) for all cohorts and focal intervals
 ## Code/Software See above for summary of the R script and STAN files
 linked to each set of data files.