Monte Carlo randomization test to assess the statistical significance of singing coordination
coor.test(X, iterations = 1000, less.than.chance = TRUE, parallel = 1, pb = TRUE,
rm.imcomp = FALSE, cutoff = 2, rm.solo = FALSE)
Data frame containing columns for singing event (sing.event), individual (indiv), and start and end time of signal (start and end).
number of iterations for shuffling and calculation of the expected number of overlaps. Default is 1000.
Logical. If TRUE
the test evaluates whether overlaps occur less often than expected by chance.
If FALSE
the opposite pattern is evaluted (whether overlaps occur more often than expected by chance).
Default is TRUE
.
Numeric. Controls whether parallel computing is applied. It specifies the number of cores to be used. Default is 1 (i.e. no parallel computing).
Logical argument to control progress bar. Default is TRUE
.
Logical. If TRUE
removes the events that don't have 2 interacting individuals. Default is
FALSE
.
Numeric. Determines the minimum number of signals per individual in a singing event. Events not meeting
this criterium are removed if rm.imcomp is TRUE
. If rm.icomp is FALSE
cutoff is ignored. Default is 2.
Note that randomization tests are not reliable with very small sample sizes. Ideally 10 or more signals per individual
should be available in each singing event.
Logical. Controls if signals that are not intercalated at the start or end of the
sequence are removed (if TRUE
). For instances the sequence of signals A-A-A-B-A-B-A-B-B-B (in which A and B represent different individuals, as in the 'indiv' column) would be subset to
A-B-A-B-A-B. Default is FALSE
.
A data frame with the following columns: #'
sing.event
: singing event ID
obs.overlaps
: observed number of overlaps
mean.random.ovlps
: mean number of overlaps expected by chance
p.value
: p value
coor.score
: coordination score (**sensu** Araya-Salas et al. 2017),
calculated as `(obs.overlaps - mean.random.ovlps) / mean.random.ovlps`.
Positive values indicate a tendency to overlap while negative values indicate a tendency to alternate.
This function calculates the probability of finding and equal or lower number
(or higher if les.than.chance is TRUE
) of song overlaps in a coordinated singing event.
The function shuffles the sequences of signals and silence-between-signals for both individuals to produce
a null distribution of expected number of overlaps by chance. The observed number of overlaps is compared to this
expected values. The p-values are calculated as the proportion of random expected values that were lower (or higher)
than the observed value. The function runs one test for each singing event in the input data frame. The function
is equivalent to the "KeepGaps" methods described in Masco et al. 2015.
Araya-Salas M., Wojczulanis-Jakubas K., Phillips E.M., Mennill D.J., Wright T.F.\ (2017) To overlap or not to overlap: context-dependent coordinated singing in lekking long-billed hermits. Anim Behav. Masco, C., Allesina, S., Mennill, D. J., and Pruett-Jones, S. (2015). The Song Overlap Null model Generator (SONG): a new tool for distinguishing between random and non-random song overlap. Bioacoustics.
# NOT RUN {
{
#load simulated singing data (see data documentation)
data(sim_coor_sing)
# testing if coordination happens less than expected by chance
coor.test(sim_coor_sing, iterations = 100, less.than.chance = TRUE)
# testing if coordination happens more than expected by chance
coor.test(sim_coor_sing, iterations = 100, less.than.chance = FALSE)
}
# }
Run the code above in your browser using DataLab