pairwise.boot: Calculate an pairwise difference between samples by bootstrap...

View source: R/pairwise.R

pairwise.bootR Documentation

Calculate an pairwise difference between samples by bootstrap without encountering a central-limit problem

Description

Calculate an pairwise difference between samples by bootstrap without encountering a central-limit problem

Usage

pairwise.boot(x, g, iter = 500, mu = "meanbp")

Arguments

x

numerical vector

g

categorical vector

iter

number of iteration

mu

comparison criterion, by default 'meanbp' (moving average per iteration: an automatic compromise between mean and median), otherwise 'mean', 'median' or 'sd'.

Value

This function returns an array of p-values like the other peerwise functions.

It calculates the number of differences between bootstrap samples that do not include 0 (all higher or all lower).

This number of differences divided by the number of iterations (iter) gives the maximum percentage of times that a convergent difference (all higher or all lower) is found: a confidence.

This value subtracted from 1 gives an equivalent of the p-value whose precision depends on the number of iterations.

Note: using the meanbp criterion is more relevant, it allows a compromise between mean and median by avoiding leverage effects.

Examples

# Example 1
data(iris)
pairwise.boot(iris[,2],iris$Species)
# Example 2 by using pairwise(type=="boot")
data(mtcars)
pairwise(mtcars$mpg[mtcars$carb<=4],mtcars$carb[mtcars$carb<=4],type="boot")

Antoine-Masse/KefiR documentation built on Feb. 22, 2024, 5:54 a.m.