rejection.path: Rejection Path Plot (for 'FDX' objects)

View source: R/plot_funs.R

rejection.pathR Documentation

Rejection Path Plot (for FDX objects)

Description

Displays the number of rejections of the raw p-values in a FDX object in dependence of the exceedance probability zeta.

Usage

rejection.path(
  x,
  xlim = NULL,
  ylim = NULL,
  main = NULL,
  xlab = expression(zeta),
  ylab = "Number of Rejections",
  verticals = FALSE,
  pch = 19,
  ref.show = FALSE,
  ref.col = "gray",
  ref.lty = 2,
  ref.lwd = 2,
  ...
)

Arguments

x

an object of class "FDX".

xlim

the x limits of the plot. If NULL (default), the (0, 1) range is used.

ylim

the y limits of the plot. If NULL (default), the double of the median of the number of possible rejections is used as upper limit.

main

main title. If NULL (default), a description string is used.

xlab, ylab

labels for x and y axis.

verticals

logical; if TRUE, draw vertical lines at steps.

pch

jump point character.

ref.show

logical; if TRUE a vertical reference line is plotted, whose height is the number of rejections of the original Benjamini-Hochberg (BH) procedure.

ref.col

color of the reference line.

ref.lty, ref.lwd

line type and thickness for the reference line.

...

further arguments to plot.stepfun.

Value

Invisibly returns a stepfun object that computes the number of rejectionsin dependence on the exceedance probability zeta.

Examples

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 (fisher.pvalues.support
# is from 'DiscreteFDR' package!)
df.formatted <- fisher.pvalues.support(counts = df, input = "noassoc")
raw.pvalues <- df.formatted$raw
pCDFlist <- df.formatted$support

DLR <- DLR(raw.pvalues, pCDFlist)
NDLR <- NDLR(raw.pvalues, pCDFlist)

rejection.path(DLR, xlim = c(0, 1), ref.show = TRUE, ref.col = "green", ref.lty = 4)
rejection.path(NDLR, col = "red", add = TRUE)


FDX documentation built on Oct. 18, 2022, 9:09 a.m.