This repository documents the statistics used for the following research paper:
Zeyl et al., "Scaling of ear morphology across 127 bird species and its implications for hearing performance", Hearing Research (2023), https://doi.org/10.1016/j.heares.2022.108679
Start with "Set up data_scl.R". This loads the data and phylogeny. This also runs the phylogenetic regressions (phylogenetic generalized least squares regressions, or PGLS) between ear measures and between each ear measure and head mass. This script also exports the summary statistics and tables to csv or word files.
First, "Set up data_scl.R" also has to be run (up to line 70) to get the data prepared. Next, the scripts in "Audiograms linked to anatomy.R" can be run to create a dataframe ('limits') containing the audiogram metrics which will be joined with the morphological data. Once the dataframe is created is created, "pgls_resids re headmass.R" can be used to run the pgls analyses with head mass-corrected values. Note that for running analyses at different cut-off levels (35 or 60 dB), the cutoff is specified in the 'Audiograms linked to anatomy.R' file. When switching cut-off levels it is recommended to to empty the environment, modify the cut-off level, and re-rerun all relevant scripts with updated cut-off
File | Description |
---|---|
"databmadded.csv" | Anatomical data |
"Column name descriptions.csv" | File describing the column names in data files |
"audiograms.csv" | Audiogram threshold data collected from literature |
"JZ tree Prum merged hackett.tree" | Phylogeny file |
File | Description |
---|---|
"Set up data_scl.R" | This is the main analysis script, which imports the data analysis and runs pgls regressions, calling formulas from other R scripts (below). Outputs are tables with statistical results exported to csv or word. |
"pgls_intraear.R" | Runs pgls regressions between auditory structures |
"pgls_HM.R" | Runs pgls regressions pgls models against head mass |
"pgls_bm.R" | Runs pgls regressions pgls models against body mass |
File | Description |
---|---|
"Audiograms linked to anatomy.R" | This is the main analysis script for pgls analyses between anatomy and audiogram metrics, which calls other scripts (below). Outputs are tables with statistical results exported to csv or word. |
"pgls_audiogram_bs.R" | Runs pgls models to predict best sensitivity |
"pgls_audiogram_hf.R" | Runs pgls models to predict high frequency limit |
"pgls_audiogram_lf.R" | Runs pgls models to predict low frequency limit |
"pgls_audiogram_bh.R" | Runs pgls models to predict best frequency |
"pgls_resids re headmass.R" | Runs the pgls analyses with head mass-corrected values |
R scripts for reproducing plots are in the 'plots' folder. The associated analysis files (if applicable) must be run before the associated plotting scripts.