Multiple testing using graphs
Description
Implements the graphical test procedure described in Bretz et al. (2009). Note that the gMCP function in the gMCP package performs the same task.
Usage
1 2 
Arguments
pvalues 
Either a vector or a matrix containing the local pvalues for the hypotheses in the rows. 
weights 
Initial weight levels for the test procedure, in case of multiple graphs this needs to be a matrix. 
alpha 
Overall alpha level of the procedure. For entangled graphs

G 
For simple graphs 
cr 
Correlation matrix that should be used for the parametric test.
If 
graph 
As an alternative to the specification via 
verbose 
If verbose is TRUE, additional information about the graphical rejection procedure is displayed. 
test 
In the parametric case there is more than one way to handle
subgraphs with less than the full alpha. If the parameter 
upscale 
Logical. If 
Value
A vector or a matrix containing the test results for the hypotheses under consideration. Significant tests are denoted by a 1, nonsignificant results by a 0.
References
Bretz, F., Maurer, W., Brannath, W. and Posch, M. (2009) A graphical approach to sequentially rejective multiple test procedures. Statistics in Medicine, 28, 586–604
Bretz, F., Maurer, W. and Hommel, G. (2010) Test and power considerations for multiple endpoint analyses using sequentially rejective graphical procedures, to appear in Statistics in Medicine
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34  #### example from Bretz et al. (2010)
weights < c(1/3, 1/3, 1/3, 0, 0, 0)
graph < rbind(c(0, 0.5, 0, 0.5, 0, 0),
c(1/3, 0, 1/3, 0, 1/3, 0),
c(0, 0.5, 0, 0, 0, 0.5),
c(0, 1, 0, 0, 0, 0),
c(0.5, 0, 0.5, 0, 0, 0),
c(0, 1, 0, 0, 0, 0))
pvals < c(0.1, 0.008, 0.005, 0.15, 0.04, 0.006)
graphTest(pvals, weights, alpha=0.025, graph)
## observe graphical procedure in detail
graphTest(pvals, weights, alpha=0.025, graph, verbose = TRUE)
## now use many pvalues (useful for power simulations)
pvals < matrix(rbeta(6e4, 1, 30), ncol = 6)
out < graphTest(pvals, weights, alpha=0.025, graph)
head(out)
## example using multiple graphs (instead of 1)
G1 < rbind(c(0,0.5,0.5,0,0), c(0,0,1,0,0),
c(0, 0, 0, 10.01, 0.01), c(0, 1, 0, 0, 0),
c(0, 0, 0, 0, 0))
G2 < rbind(c(0,0,1,0,0), c(0.5,0,0.5,0,0),
c(0, 0, 0, 0.01, 10.01), c(0, 0, 0, 0, 0),
c(1, 0, 0, 0, 0))
weights < rbind(c(1, 0, 0, 0, 0), c(0, 1, 0, 0, 0))
pvals < c(0.012, 0.025, 0.005, 0.0015, 0.0045)
out < graphTest(pvals, weights, alpha=c(0.0125, 0.0125), G=list(G1, G2), verbose = TRUE)
## now again with many pvalues
pvals < matrix(rbeta(5e4, 1, 30), ncol = 5)
out < graphTest(pvals, weights, alpha=c(0.0125, 0.0125), G=list(G1, G2))
head(out)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.