eff_nbr_tests: Effective number of tests

Description Usage Arguments Value References Examples

View source: R/eff_nbr_tests.R

Description

Calculates the effective number of tests performed in a GWAS, given the LD structure among the SNPs. SNPs that are highly correlated are not counted twice.

Usage

1
eff_nbr_tests(mat, cor.true = FALSE)

Arguments

mat

matrix, either individual by SNPs (n x p) matrix, or correlation matrix between SNPs

cor.true

indicates if option mat is a correlation matrix or not

Value

zhc.correction number of effective tests

References

Implemented from https://www.ncbi.nlm.nih.gov/pubmed/18271029

Examples

1
2
3
dat.sim <- data.frame(g = rnorm(100)) %>% dplyr::mutate(g2 = g*2)
eff_nbr_tests(diag(10), cor.true = TRUE) ## 10, because all are independent
eff_nbr_tests(dat.sim, cor.true = FALSE)

sinarueeger/GWAS.utils documentation built on Dec. 2, 2018, 12:17 p.m.