--- title: "ZLAvian" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{vignette} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, warning = FALSE, comment = "#>" ) ``` ## Introduction The package ZLAvian tests for patterns consistent with Zipf's Law of Abbreviation (ZLA) in animal communication following the methods described in Lewis et al. (2023) and Gilman et al. (2023). ```{r setup} library(ZLAvian) ``` ## testZLA This function measures and tests the statistical significance of the concordance between note duration and frequency of use in a sample of animal communication represented in a dataframe that must include columns with the following names and information: Other columns in the dataframe are ignored in the analysis. Youngblood (2024) observed that the column duration might alternatively include data on any other numerical measure that estimates the effort involved in producing a note type. testZLA computes the mean concordance (i.e., Kendall's tau) between note duration and frequency of use within individuals, averages across all individuals in the data set, and compares this to the expectation under the null hypothesis that note duration and frequency of use are unrelated. The null distribution is computed by permutation while constraining for the observed similarity of note repertoires among individuals. This controls for the possibility that individuals in the population learn their repertoires from others. The significance test is one-tailed, so p-values close to 1 suggest evidence for a positive concordances, contrary to ZLA. See Lewis at al. (2023) for the formal computation of the null distribution and Gilman et al. (2023) for discussion. Users can control the following parameters in testZLA: ```{r, warning = FALSE} data(testdata, package = "ZLAvian") ``` ```{r, include = FALSE} data = Java.sparrow.notes ``` ```{r, warning = FALSE} test.ZLA.output = testZLA(data, minimum = 1, null = 999, est = "mixed", cores = 2) ``` testZLA prints a table that reports concordances (tau) and p-values at the individual and population levels. Results at the individual level are obtained using the method described in Lewis et al (2023) and Gilman et al (2023). Results at the population level report the concordance between note type duration and frequency of use in the full dataset, without considering which individuals produced which notes. Population-level concordances may be problematic when studying ZLA in animal communication (see Gilman et al 2023 for discussion) but have been widely used to study ZLA in human languages. Further information can be extracted from the function: