Learn R Programming

fmsb (version 0.7.6)

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, ...)

Value

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

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().

Author

Minato Nakazawa minatonakazawa@gmail.com https://minato.sip21c.org/. The code of this function was provided by Dr. Shigenobu AOKI (Gunma Univ.).

See Also

pairwise.prop.test, p.adjust.methods

Examples

Run this code
 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 DataLab