hdrs.test: A two-sample permutation test for differences in 'hdrs'...

Description Usage Arguments Value Note Examples

View source: R/hdrs.test.R

Description

A two-sample permutation test for differences in hdrs values.

Usage

1
2
hdrs.test(x, y, alternative = "two.tailed", p = 80, nsim = 5000,
  nperm = 5000, ncores = 1)

Arguments

x

A vector of individual completion times for the focal activity.

y

A vector of individual completion times for the focal activity.

alternative

A character string specifying the alternative hypothesis, must be one of "two.sided" (default), "more.sync" or "less.sync".

p

A number indicating the percentage of individuals that have completed the focal activity. The default is 80.

nsim

The number of simulations used to esimtate the HDR. The default is 5000.

ncores

The number of processor cores over which to distribute the nboot replicates. The default is 1.

ci

A number indicating the desired confidence level. The default is 95.

nboot

The number of bootstrap replicates used to estimate the CIs. The default is 5000.

Value

A list of class "hdrstest" containing the following values.

Note

The hdrs metric quantifies the amount of time it took for p percent of the sampled individuals to complete the specified activity (e.g., mating, calving, etc...). Therefore, a smaller hdrs value indicates a more synchronous population, while a larger hdrs value indicates less synchrony. Consequently, the alternative hypothesis that x is more synchronous than y ("more.sync") is equivalent to hdrs(x) < hdrs(y), while the "less.sync" alternative implies hdrs(x) > hdrs(y). The null hypothesis is always hdrs(x) = hdrs(y), and the default "two.tailed" alternative is simply hdrs(x) != hdrs(y).

The ncores argument specifies the number of processor cores over which the foreach loop will distribute permutation re-samples. This should be set no higher than the number of hyperthreaded cores on your machine, which is usually twice the number of physical cores.

Examples

1
2
3
x <- rexp(25)
y <- rexp(25, rate=0.5)
hdrs.conf(x, y, alternative="more.sync", nperm=250)

jmcalabrese/hdrs documentation built on May 22, 2019, 5:34 p.m.