DiscreteFDR (version 1.0)

fisher.pvalues.support: Computing discrete p-values and their support for Fisher's exact tests

Description

Computes discrete raw p-values and their support for the test of no association between two categorical variables in 2 x 2 contingency tables using Fisher's exact tests.

Usage

fisher.pvalues.support(counts, alternative = "greater")

Arguments

counts

a data frame of 3 columns and any number of lines, each line being an item for which we want to perform a test. The first column is the name of the item, the second is the count of associations between the item and the condition, the third is the count of no associations.

alternative

same argument as in fisher.test.

Value

A list of two elements:

raw

raw discrete p-values

support

a list of the supports of the CDFs of the p-values. Each support is represented by a vector in increasing order.

Details

The code for this function is inspired from the example in the help page of p.discrete.adjust.

See the Wikipedia article about Fisher's exact test, paragraph Example, for a good depiction of what the code does for each possible value of alternative.

This version: 2018-03-20.

References

"Fisher's exact test", Wikipedia, The Free Encyclopedia, accessed 2018-03-20, link

See Also

p.discrete.adjust, fisher.test

Examples

Run this code
# NOT RUN {
data(amnesia)

#We only keep the first 100 lines to keep the computations fast.
amnesia<-amnesia[1:100,]

#Construction of the p-values and their support
amnesia.formatted <- fisher.pvalues.support(amnesia)
raw.pvalues <- amnesia.formatted$raw
pCDFlist <- amnesia.formatted$support
# }

Run the code above in your browser using DataCamp Workspace