Learn R Programming

DiscreteFDR (version 2.1.0)

hist.DiscreteFDR: Histogram of Raw P-Values

Description

Computes a histogram of the raw p-values of a DiscreteFDR object.

Usage

# S3 method for DiscreteFDR
hist(x, breaks = "FD", mode = c("raw", "selected"), ...)

Value

An object of class histogram.

Arguments

x

an object of class DiscreteFDR.

breaks

as in graphics::hist(); here, the Friedman-Diaconis algorithm ("FD") is used as default.

mode

single character string specifying for which $p$-values the histogram is to be generated; must either be "raw" or "selected".

...

further arguments to graphics::hist() or graphics::plot.histogram(), respectively.

Details

If x does not contain results of a selection approach, a warning is issued and a histogram of the raw p-values is drawn.

Examples

Run this code
X1 <- c(4, 2, 2, 14, 6, 9, 4, 0, 1)
X2 <- c(0, 0, 1, 3, 2, 1, 2, 2, 2)
N1 <- rep(148, 9)
N2 <- rep(132, 9)
Y1 <- N1 - X1
Y2 <- N2 - X2
df <- data.frame(X1, Y1, X2, Y2)
df

# Compute p-values and their supports of Fisher's exact test
test.result <- generate.pvalues(df, "fisher")
raw.pvalues <- test.result$get_pvalues()
pCDFlist <- test.result$get_pvalue_supports()

# DBH (SU)
DBH <- DBH(raw.pvalues, pCDFlist)
hist(DBH)

Run the code above in your browser using DataLab