set.seed(5193)
### Make some p-values
m=500 #the nr of hypotheses
nrfalse=100 #the nr of false hypotheses
tstats = rnorm(n=m) #m test statistics
tstats[1:nrfalse] = tstats[1:nrfalse] + 3 #add some signal
P = 1 - pnorm(tstats) #compute p-values
### Compute kappa.max. (Taking c to be the default value 1/(2m).)
kappa.max = get.kappa.max(P=P)
kappa.max
Run the code above in your browser using DataLab