Description Usage Arguments Details Value Note Author(s) Examples
Computes the fixed effects meta-analysis estimator while accounting for correlations between effect estimates in the variance estimation. The computation is done for a single SNP at a time.
1 | corMeta.GLS.1(beta.1, var.1, cov.1)
|
beta.1 |
A vector of S effect estimates |
var.1 |
A vector of S variances of the effect estimates in beta.1 |
cov.1 |
A vector of S*(S-1)/2 covariances between the effect estimates in beta.1 |
Computes the MetaGLS (MetaCor1 form the MetaCor paper) estimator and test for a single SNP.
A data frame with 1 row, with beta, var, test.stat and pval providing the meta-analysis effect estimate, its variance, test statistic, and p-value.
This function is called by MetaCor and it is advisable to use MetaCor. It can also be called directly, but then the test of heterogeneity is not performed. Also, MetaCor allows for selection of strata while this function does not.
Tamar Sofer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 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")
corMeta.GLS.1(effects[1,], vars[1,], covs[1,], testType = "MetaGLS")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.