hist.FDX | R Documentation |
Computes a histogram of the raw p-values of a FDX
object.
## S3 method for class 'FDX'
hist(x, breaks = "FD", mode = c("raw", "selected", "weighted"), ...)
x |
object of class |
breaks |
as in |
mode |
single character string specifying for which $p$-values the
histogram is to be generated; must be one of |
... |
further arguments to |
If x
does not contain results of a weighting or selection approach, a
warning is issued and a histogram of the raw p-values is drawn.
An object of class histogram
.
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
# Construction of the p-values and their supports with Fisher's exact test
library(DiscreteTests) # for Fisher's exact test
test.results <- fisher_test_pv(df)
raw.pvalues <- test.results$get_pvalues()
pCDFlist <- test.results$get_pvalue_supports()
# DGR
DGR <- DGR(raw.pvalues, pCDFlist)
# histogram of raw p-values
hist(DGR)
# arithmetic-weighted GR (using 1 - raw.pvalues as weights)
wGR <- wGR.AM(raw.pvalues, 1 - raw.pvalues)
# histogram of raw p-values
hist(wGR)
# histogram of weighted p-values
hist(wGR, mode = "weighted")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.