pairwise.boot | R Documentation |
Calculate an pairwise difference between samples by bootstrap without encountering a central-limit problem
pairwise.boot(x, g, iter = 500, mu = "meanbp")
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'. |
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.
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.