getApproxCovar: Obtain a null covariance matrix of binned test statistics

Description Usage Arguments Value Note Examples

View source: R/F_getApproxCovar.R

Description

Obtain a null covariance matrix of binned test statistics

Usage

1
getApproxCovar(statsPerm, nBins = 82L, binEdges = c(-4.1, 4.1))

Arguments

statsPerm

The pxB matrix of permutation z-values in the columns

nBins

an integer, the number of bins

binEdges

A vector of length 2 with the outer bin edges

Value

The covariance matrix of binned z-values

Note

This is not the covariance matrix of the p test statistic, nor of the data! It is an approximate covariance matrix of binned test statistics for visualization purposes.

Examples

1
2
3
4
5
6
7
8
9
p = 200; n = 50; B = 5e1
x = rep(c(0,1), each = n/2)
mat = cbind(
matrix(rnorm(n*p/10, mean = 5+x),n,p/10), #DA
matrix(rnorm(n*p*9/10, mean = 5),n,p*9/10) #Non DA
)
mat = mat = mat + rnorm(n, sd = 0.3) #Introduce some dependence
fdrRes = reconsi(mat, x, B = B)
corMat = getApproxCovar(fdrRes$statsPerm)

reconsi documentation built on Nov. 8, 2020, 5:04 p.m.