The data and code here supports the manuscript "Lifetime costly maternal investment in killer whales". All data is stored in the file "srkw_reproduction_data.csv". The columns of this file are: female_id: a unique identifier for each individual female year: the year of the survey age: the age of the female in that year birth: whether that female successfully calved in each year (0 = no, 1 = yes) n_sons: number of weaned sons the female had at the start of the year n_daughters: number of weaned daughter the female had at the start of the year n_dead_sons: number of sons the female had weaned, but were no longer alive nonson_males: number of weaned males in the females matriline that aren't their son unknwon_matriline: number of weaned individuals of unknown sex in the matriline age_sons: mean age of surviving sons, set to 0 for females with no sons The three R scripts included run the main analysis, sensitivity analysis for priors, and produce the plots included in the MS. The analysis script ("final_analysis_script.R") should be run first to produce the .rds objects of the statistical models. These are then used in subsequent scripts.