# These are the unadjusted p-values corresponding to the outcome of some
# multiple testing experiment. The first 500 hypotheses are null and the last
# 1500 are true alternatives.
unadjp <- c(runif(500, 0, 0.01), runif(1500, 0, 1))
names(unadjp) <- paste("Hyp:", 1:2000)
# Here there are two groups total we have randomly assigned hypotheses to
# these two groups.
group.index <- c(sample(1:2, 2000, replace = TRUE))
# Perform the GBH adjustment.
result <- Adaptive.GBH(unadjp, group.index, method = "storey")
# A summary of the GBH adjustment
summary(result)
# The estimated proportions of null hypotheses, between groups
result@pi0
# Visualizing the sorted p-values, before and after adjustment
plot(result, adjust = TRUE)
plot(result, adjust = FALSE)
Run the code above in your browser using DataLab