Estimates a null correlation matrix from data using simple z score threshold

estimate_null_correlation_simple(data, z_thresh = 2, est_cor = TRUE)

Arguments

data

a mash data object, eg as created by mash_set_data

z_thresh

the z score threshold below which to call an effect null

est_cor

whether to estimate correlation matrix (TRUE) or the covariance matrix (FALSE).

Details

Returns a simple estimate of the correlation matrix (or covariance matrix) among conditions under the null. Specifically, the simple estimate is the empirical correlation (or covariance) matrix of the z scores for those effects that have (absolute) z score < z_thresh in all conditions.

Examples

simdata = simple_sims(50,5,1)
data = mash_set_data(simdata$Bhat, simdata$Shat)
estimate_null_correlation_simple(data)
#>             condition_1 condition_2 condition_3 condition_4 condition_5
#> condition_1  1.00000000  0.08190116  0.16592180  0.09587405  0.26978201
#> condition_2  0.08190116  1.00000000 -0.04745009 -0.14812270  0.10633083
#> condition_3  0.16592180 -0.04745009  1.00000000  0.04719117  0.23520179
#> condition_4  0.09587405 -0.14812270  0.04719117  1.00000000 -0.01296703
#> condition_5  0.26978201  0.10633083  0.23520179 -0.01296703  1.00000000