sampleRD: Sampling a randomization distribution

View source: R/sampleRD.R

sampleRDR Documentation

Sampling a randomization distribution

Description

sampleRD samples the randomization distribution for Fisher or paired sample test

Usage

sampleRD(x, mu = 0, NRAND = 4999)

Arguments

x

a (non-empty) numeric vector of data values.

mu

an scalar; it is the value of mu under the null hypothesis

NRAND

numeric; the number of randomizations (permutations).

Details

The procedure calculates first the sumD-statistic for the observed data, where sumD stands for the differences x - mu, and mu is a hypothesized value for mu under a null hypothesis (usually set to 0, the default. Then, the randomization procedure decides to change sign of each x - mu or not, after a coin flip. The number of coin flips are controlled by the parameter NRAND thus producing the randomization distribution of sumD differences.

Value

The function returns a list containing the value of the sumD statistic and the p-values of the sampled randomization distribution for the three types of alternatives, and the number of randomizations + 1

Author(s)

Jorge Navarro-Alberto

References

Manly, B.F.J. and Navarro-Alberto, J.A. (2021) Randomization, Bootstrap and Monte Carlo Methods in Biology. 4th Edition. Chapman and Hall/ CRC Press.

See Also

RT1SAMP

Examples

data(cornheight)
Dif <- cornheight[,"Cross"] - cornheight[,"Self"]
Results.RD <- sampleRD(Dif)


ganava4/rbmc documentation built on April 24, 2022, 12:14 a.m.