File: hommel.R

package info (click to toggle)
r-cran-statmod 1.4.20-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 332 kB
  • ctags: 13
  • sloc: fortran: 75; makefile: 3
file content (21 lines) | stat: -rw-r--r-- 552 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
hommel.test <-
#	Multiple testing from Hommel (1988).
#	Similar but very slightly more powerful that Hochberg (1988).
#	Controls Family-Wise Error rate for hypotheses which are independent or
#	which satisfy the free-association condition of Simes (1986).
#	Gordon Smyth, Walter and Eliza Hall Institute, smyth@wehi.edu.au
#	29 Aug 2002

function(p,alpha=0.05) {
	n <- length(p)
	i <- 1:n
	po <- sort(p)
	j <- n
	repeat {
		k <- 1:j
		if(all( po[n - j + k] > k * alpha / j )) break
		j <- j-1
		if(j == 0) break
	}
	p >= alpha/j
}