fmsb (version 0.6.3)

pairwise.fisher.test: Exact version of pairwise.prop.test

Description

By conducting repeatedly Fisher's exact tests instead of chi-square tests, this function can test the null-hypothesis of no difference in any pair of proportions for more than 2 groups, with adjustment of type I error for multiple comparison.

Usage

pairwise.fisher.test(x, n, p.adjust.method, ...)

Arguments

x

A integer vector of event occurences

n

A integer vector of trials

p.adjust.method

A name in p.adjust.methods to specify the method to adjust type I error for multiple comparisons. Default is "holm".

...

Miscellaneous arguments to be given for fisher.test().

Value

An object of adjusted p-values for all possible comparisons of pairs with class pairwise.htest.

See Also

pairwise.prop.test, p.adjust.methods

Examples

Run this code
# NOT RUN {
 pairwise.fisher.test(c(2, 4, 5), c(10, 14, 17), p.adjust.method="bonferroni")
 smoker <- c(2, 1, 7)
 total <- c(11, 14, 10)
 names(total) <- c("A", "B", "C")
 pairwise.fisher.test(smoker, total)
# }

Run the code above in your browser using DataCamp Workspace