# 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
m <- length(raw.pvalues)
alpha <- 0.05
#Compute the step functions from the supports
stepf <- build.stepfuns(pCDFlist)
#We stay in a step-down context, where pv.numer=pv.denom,
#for the sake of simplicity
#If not searching for critical constants, we use only the observed p-values
sorted.pvals <- sort(raw.pvalues)
y <- kernel.ADBH.fast("", stepf, sorted.pvals, sorted.pvals)
#If searching for critical constants, we use (almost) the complete support
pv.list.all <- unique(sort(as.numeric(unlist(pCDFlist))))
# apply the shortcut drawn from Lemma 4, that is
# c.1 >= the effective critical value associated to alpha/(m + alpha)
pv.list<-short.eff(pv.list.all, alpha/(m + alpha) )
# then re-add the observed p-values (needed to compute the adjusted p-values),
# because we may have removed some of them the shortcut
pv.list <- sort(unique(c(pv.list, sorted.pvals)))
# compute transformed support
y <- kernel.ADBH.crit("", stepf, pv.list, pv.list, alpha, sorted.pvals)
crit.constants <- y$crit.consts
#The following exists only for step-down direction
transformed.pvalues <- y$pval.transf
# }
Run the code above in your browser using DataCamp Workspace