Data and code from: Spatial heterogeneity in density dependence across life-history stages drives the dynamics of a bird metapopulation
Data files
Jan 28, 2026 version files 4.89 MB
-
Analyses_in_brms_ECY25-1341.R
7.21 KB
-
brm2table_short_ECY25-1341.R
2.79 KB
-
cleaned_density_dependence_data_ECY25-1341.txt
49.46 KB
-
CMR_juvenile_to_adult_one_ind_per_isl_full_model_ECY25-1341.stan
9.41 KB
-
CMR_nest_to_ad_dispersers_ELASTICITY_gen_quant_block_ECY25-1341.stan
15.20 KB
-
CMR2table_adults_ECY25-1341.R
1.30 KB
-
CMR2table_juveniles_ECY25-1341.R
3.91 KB
-
estimated_pop_sizes_nestling_to_adult_model_with_lurøy_onøy_ECY25-1341.txt
24.03 KB
-
Functions_to_generate_tables_and_figures_from_stan_and_brms_outputs_ECY25-1341.R
29.15 KB
-
Juvenile_mark-recapture_ECY25-1341.R
6.90 KB
-
juvenile_to_ad_surival_histories_long_ECY25-1341.txt
853.03 KB
-
Main_model_of_metapopulation_dynamics_ECY25-1341.R
25.78 KB
-
nestling_producers_2007_2014_ECY25-1341.txt
227.78 KB
-
Parameter_to_latex_ECY25-1341.csv
1.99 KB
-
presence_data_1994_2022_ECY25-1341.txt
3.52 MB
-
README.md
9.68 KB
-
sex_genetically_corrected_ECY25-1341.txt
40.71 KB
-
Tables_and_figures_submission_2_ECY25-1341.R
59.94 KB
Abstract
Dataset DOI: 10.5061/dryad.rr4xgxdnq
Description of the data and file structure
This field data was collected from a metapopulation of house sparrows (Passer domesticus) inhabiting 11 islands off the Helgeland coast in northern Norway. The presence-absence data, paired with a genomic pedigree, were used to estimate survival and reproduction using generalised linear mixed models in a capture-mark-recapture framework.
Files and variables
File: presence_data_1994_2022_ECY25-1341.txt
Description:
Variables
- Year: year of observation
- date: date of observation
- scriptsex: the sex of an individual. For juveniles, this may have been inferred from subsequent recapture in the adult stage. NA is "not available". NA cells are filled with values from the dataset sex_genetically_corrected_ECY25-1341.txt, or are given a random sex, in the script "Main model of metapopulation dynamics.R"
- Island: Observation island, numeric code
- Location: Observation island, name
- stage: Type of observation; nestling inside the nest (at ringing or resighting) = "nest". Adult or fledged juvenile identified by capture outside the nest (at ringing or resighting) = "capt". Adult or fledged juvenile identified by colour rings using visual resigthing outside the nest = "obs".
- Least_age: The least possible age of an individual. Individuals first ringed as adults were assumed to be in their second calendar year.
- Least_hatchyear: The least possible hatch year of an individual. Individuals first ringed as adults were assumed to be in their second calendar year.
- ID: The ID of an individual bird, specific to this data set and "sex_genetically_corrected_ECY25-1341.txt".
File: sex_genetically_corrected_ECY25-1341.txt
Description:
Variables
- sex: Genetically estimated sex
- ID: The ID of an individual bird, specific to this data set and "presence_data_1994_2022_ECY25-1341.txt".
File: estimated_pop_sizes_nestling_to_adult_model_with_lurøy_onøy_ECY25-1341.txt
Description:
Variables
- Location: Observation island, name
- Island: Observation island, numeric code
- Year: year of observation
- N_corr: The observed number of adult individuals in a given island and year (N_obs), corrected by recapture probability. See main text for explanation of methods.
- .lower: 90% credible interval of N_corr. Lower limit
- .upper: 90% credible interval of N_corr. Upper limit
- .width: The credible interval (90 %)
- N_obs: The observed number of adult individuals in a given island and year
File: cleaned_density_dependence_data_ECY25-1341.txt
Description:
Variables
- Year_ID_Location: year of observation, ID of individual bird (specific to this dataset) and observation island name
- Year_ID: year of observation, ID of individual bird (specific to this dataset)
- ID: ID of individual bird (specific to this dataset)
- Year_Location: year of observation and observation island name
- Year: year of observation
- Location: observation island name
- Island: observation island numeric code
- Least_age: The least possible age of an individual. Individuals first ringed as adults were assumed to be in their second calendar year.
- Least_hatchyear: The least possible hatch year of an individual. Individuals first ringed as adults were assumed to be in their second calendar year
- filled: Indicates if presence has been inferred from subsequent recapture in a following year, or from genetic presence (the individual was registered with offspring but not seen) = 1. The individual was physically observed/capture = 0.
- obs: Type of observation; Adult or fledged juvenile identified by colour rings using visual resigthing outside the nest = "obs". NA is not available. Each row has at least one cell with non-NA for the columns obs, capt or gene_new.
- capt: Type of observation; Adult or fledged juvenile identified by capture outside the nest (at ringing or resighting) = "capt". NA is not available. Each row has at least one cell with non-NA for the columns obs, capt or gene_new.
- gene_new: Indicates if presence has been inferred from genetic presence (the individual was registered with offspring but not seen) = 1. The individual was physically observed/captured = 0. NA is not available. Each row has at least one cell with non-NA for the columns obs, capt or gene_new.
- sex: The sex of an individual. Estimated by plumage or genetically.
- Own_survival: Indicates if an individual survived (was registered) in the following year = 1. Not registered in the following year = 0.
- N_Recruits: The number of offspring produced by an individual in the present year that survived to recruitment in the following year.
- r2s: The individual demographic contribution = N_Recruits + 2*Own_survival.
- in_out: Indicates if an island belongs to the "outer system" = 0 or "inner system" = 1.
File: nestling_producers_2007_2014_ECY25-1341.txt
Description:
Variables
- Year_ID_Location: year of observation, ID of individual bird (specific to this dataset) and observation island name
- Year_ID: year of observation, ID of individual bird (specific to this dataset)
- ID: ID of individual bird (specific to this dataset)
- Year_Location: year of observation and observation island name
- Year: year of observation
- Location: observation island name
- Island: observation island numeric code
- Least_age: The least possible age of an individual. Individuals first ringed as adults were assumed to be in their second calendar year.
- Least_age_sq: Least_age squared
- Least_hatchyear: The least possible hatch year of an individual. Individuals first ringed as adults were assumed to be in their second calendar year.
- filled: Indicates if presence has been inferred from subsequent recapture in a following year, or from genetic presence (the individual was registered with offspring but not seen) = 1. The individual was physically observed/capture = 0.
- obs: Type of observation; Adult or fledged juvenile identified by colour rings using visual resigthing outside the nest = "obs". NA is not available. Each row has at least one cell with non-NA for the columns obs, capt or gene_new.
- capt: Type of observation; Adult or fledged juvenile identified by capture outside the nest (at ringing or resighting) = "capt". NA is not available. Each row has at least one cell with non-NA for the columns obs, capt or gene_new.
- gene_new: Indicates if presence has been inferred from genetic presence (the individual was registered with offspring but not seen) = 1. The individual was physically observed/captured = 0. NA is not available. Each row has at least one cell with non-NA for the columns obs, capt or gene_new.
- Own_survival: Indicates if an individual survived (was registered) in the following year = 1. Not registered in the following year = 0.
- in_out: Indicates if an island belongs to the "outer system" = 0 or "inner system" = 1.
- sex: The sex of an individual. Estimated by plumage or genetically.
- N_nestlings: The number of nesltings produced by an individual in the present year.
- N_Recruits: The number of offspring produced by an individual in the present year that survived to recruitment in the following year.
- r2s: The individual demographic contribution = N_Recruits + 2*Own_survival.
File: juvenile_to_ad_surival_histories_long_ECY25-1341.txt
Description:
Variables
- ID: ID of individual bird (specific to this dataset)
- lifestage: The life-history stage of a bird at observation: "nest" = nestling. "fledge" = fledged juvenile. "recruit" = second calendar year adult. "adult" = third calendare year adult or older.
- Year: year of observation
- Location: observation island name
- Island: observation island numeric code
Code/software
R (version 4.0.5 ) and Stan (version 2.32.2) were used to analyse this data.
R packages needed:
library(Matrix)
library(tidyverse)
library(brms)
library(lme4)
library(rstan)
library(arm)
library(parallel)
library(shinystan)
library(writexl)
library(arm)
library(tidybayes)
library(tables)
library(knitr)
library(kableExtra)
library(xtable)
Scripts should be run in this order:
- Main_model_of_metapopulation_dynamics_ECY25-1341.R
- Juvenile_mark-recapture_ECY25-1341.R
- Analyses_in_brms_ECY25-1341.R
- Tables_and_figures_submission_2_ECY25-1341.R
- Stan scripts - called by the two first R scripts:
- CMR_nest_to_ad_dispersers_ELASTICITY_gen_quant_block_ECY25-1341.stan
- CMR_juvenile_to_adult_one_ind_per_isl_full_model_ECY25-1341.stan
- The below scripts are functions called by Tables_and_figures_submission_2_ECY25-1341.R to produce tables and figures:
- brm2table_short_ECY25-1341.R
- CMR2table_adults_ECY25-1341.R
- CMR2table_juveniles_ECY25-1341.R
- Functions_to_generate_tables_and_figures_from_stan_and_brms_outputs_ECY25-1341.R
- Parameter_to_latex_ECY25-1341.csv: translates model parameter names to names that appear in tables.
Scripts are also located at:
https://github.com/torhanssonfrank/DensityRegulationHouseSparrows/tree/main/R%20scripts
Access information
Other publicly accessible locations of the data:
