hier.test: Decision-making Function for Generalized Hierarchical Testing...

Description Usage Arguments Value Author(s) References Examples

Description

Given a set of p-values, return the decisions using the generalized stepwise procedure.

Usage

1
hier.test(tree, pvals, alpha, type)

Arguments

tree

the edgelist parameterizing the hierarchical structure between hypotheses. The edges must be stored so that each edge is a row of a two column matrix, where the first column gives the parent and the second gives the child.

pvals

a vector of raw p-values resulting from an experiment. The names of this vector should be contained in the edgelist parameterizing the hierarchical structure between hypothesis, inputted as tree

alpha

the significant level used to calculate the critical values to make decisions.

type

the type of dependence structure of the hierarchically ordered hypotheses. Currently, we provide four types of dependence: "positive", "arbitrary", "block positive" and "block arbitrary".

Value

logical values of each hypothesis being rejected or not, if TRUE, then the hypothesis is rejected; otherwise, the hypothesis is not rejected.

Author(s)

Yalin Zhu

References

Lynch, G., Guo, W. (2016). On Procedures Controlling the FDR for Testing Hierarchically Ordered Hypotheses. arXiv preprint arXiv:1612.04467.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(igraph)
library(ape)
library(structSSI)
library(phyloseq)
data("chlamydiae")
environments <- sample_data(chlamydiae)$SampleType
abundances <- otu_table(chlamydiae)

graph.tree <- as.igraph(phy_tree(chlamydiae))
edge.tree <- get.edgelist(graph.tree)
pVal <- treePValues(edge.tree, abundances, environments)
pVal[which(is.na(pVal))] = 1;		# these have all 0 abundances in every environment
decision1 <- hier.test(tree = graph.tree, pvals = pVal, alpha = 0.01, type = "positive")
decision2 <- hier.test(tree = graph.tree, pvals = pVal, alpha = 0.01, type = "arbitrary")
## show the number of rejections under different types of dependence
length(which(decision1 == TRUE)); length(which(decision2 == TRUE))

allenzhuaz/MHThier documentation built on May 6, 2019, 1:30 a.m.