Description Usage Arguments Value Author(s) Examples
Given association analysis results and covariances between the stratum-specific estimates, perform meta-analysis using MetaCor.
1 |
dat |
A matrix with rows corresponding to m SNPs, and columns with the following information (note that this matrix is prepared by the function stratLMMTest that calls this function) ID for each SNP, columns with names "Beta.strat_name", "var.strat_name", "cov.strat_name:other_strat_name" corresponding to estimated SNP effect, variances of these estimators, and covariances between them, for a few strata (at least 2). |
block.size |
Number of SNPs to meta-analyze together (to speed computation). Used only if MetaGLS is testType. Default is 50,000. |
testType |
Either MetaGLS (MetaCor2 from paper) or MetaCor.fixef (MetaCor1 from paper). If an unfamiliar test name is specified, will be taken to be MetaGLS. |
subgroup.vec |
If one wants to meta-analyze only some of the strata, specify the names in this vector of strings. |
test.heterogeneity |
Should a test of heterogeneity between stratum-specific effects be performed? default is yes. |
verbose |
If verbose, print progress updates. |
return a matrix with information for each SNP - meta.beta, meta.se, meta.test and meta.pval are the meta-analyzed effect sizes, standard errors, test statistics and p-values. Similar information is given for the test of heterogeneity using hetero.pval, etc.
Tamar Sofer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ### This function is used by stratLMMTest when combining the effect estimates from all strata. Example of usage outside of stratLMMTest:
### create a small data set with the right formating:
require(mvtnorm)
n.strat <- 5
n.est <- 5
## create a positive definite matrix to be a covariance matrix
sigma <- matrix(rnorm(n.strat^2), n.strat, n.strat)
sigma <- t(sigma)
effects <- rmvnorm(n.est, c(2,2,3,3,0), sigma)
colnames(effects) <- paste0("Beta.s", 1:n.strat)
vars <- matrix(rep(diag(sigma), n.est), nrow = n.est, ncol = n.strat, byrow = T)
colnames(vars) <- paste0("var.s", 1:n.strat)
covs <- matrix(rep(sigma[lower.tri(sigma)], n.est), nrow = n.est, byrow = T)
colnames(covs) <- c(paste0("cov.s1:", paste0("s", 2:n.strat)), paste0("cov.s2:", paste0("s", 3:n.strat)), paste0("cov.s3:", paste0("s", 4:n.strat)) , "cov.s4:s5")
dat <- cbind(data.frame(snpID = 1:n.est), effects, vars, covs)
## test:
MetaCor(dat) ## uses MetaGLS, MetaCor2 from the paper
MetaCor(dat, testType = "MetaCor.fixef") ## MetaCor1 from paper
MetaCor(dat, testType = "MetaCor.fixed") ## if wrong name of test, it uses MetaGLS
## can choose to meta-analyze only part of the strata:
MetaCor(dat, subgroup.vec = c("s1", "s2", "s5"), testType = "MetaCor.fixef")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.