README.md

R/corihw: Independent Hypothesis Weighting for Correlated Tests

Yair Goldberg

R/corihw is an R package. This package generalizes independent hypothesis weighting (IHW) multiple testing procedure to correlated tests. It enables using of both correlation between the tests and covarites that are informative under the alternative to increases power over the Bonfferoni correction.

Installation

You can install it from its GitHub repository. You first need to install the devtools package and IHW package.

install.packages("devtools")
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("IHW")

Then install R/corihw using the install_github function in the devtools package.

library(devtools)
install_github("yairgoldy/corihw")

Example use

Create a 20,000 two-sample t-tests with correlations . Let $\mu=1$ be the mean under the alternative and $\mu=0$ the mean under the null. The proportion of alternatives is 0.05. Let $H_{m\times 1}\in{0,1}$ be a vector such that $H_j\sim \text{Bernoulli}(0.05)$ are independent. The first sample of $15$ observations is drawn from a multivariate random vector $N(H\mu,R)$, and the second sample of $15$ observations is drawn from $N(0_{m\times 1},R)$. The correlation matrix $R$ is block diagonal with a given block size of 100 and with off-diagonal entries of $\rho=0.9$.


library(corihw)
dat <- toy_example(m=20000,n=15,mu=1,prob=0.05, block_size=100,rho=0.9)

Compare IHW, CorIHW, and CorIHW based on M-effective.

sol <- corihw (pvalues = dat$P,covariates = dat$X,alpha = 0.1,lambda=5, Sigma=dat$Sigma,
               methods= c("IHW","CorIHW","M-effective"))


rejections <- data.frame(IHW  = sum(sol$rjs_IHW),
                        CorIHW = sum(sol$rjs_Cor),
                        meffective = sum(sol$rjs_meffective))
rejections




yairgoldy/corihw documentation built on Sept. 10, 2020, 11:33 p.m.