generate_data_re1: Simulate summary statistics according to random effects...

Description Usage Arguments Value Examples

View source: R/source1.R

Description

Simulate summary statistics according to random effects model.

Usage

1
2
generate_data_re1(M = 50 * 10^3, p = 0.01, tau2 = 0.00025,
  resref = NULL, n = rep(50 * 10^3, 10), I2 = 0.3)

Arguments

M

number of SNPs for which to simulate summary stats.

p

proportion of SNPs with real non-zero effects.

tau2

variance of real associated non-zero SNPs.

resref

an optional vector of residual variances to sample from (with replacement) when generating the standard errors for the summary stats. Default is NULL, in which case the residual variances calculated from a Cigarretes Per Day GWAS (Liu, Jiang 2019) are used.

n

vector of sample sizes from the contributing studies.

I2

the I2 heterogeneity statistic for each SNP. The variance of study-level effects around population level effect at each SNP is specified given I2 level (between 0,1) and the simulated standard errors.

alpha

variance inflation factor of outlier studies.

Value

A list containing: An Mxk matrix of effect size estimates betajk, An Mxk matrix of effect size estimate variances sjk2, M-length vector inverse-variance weighted meta-analysis z-scores meta.z, an M-length binary vector indicating real / non-real effect at each SNP Rj, an M-length binary vector indicating true effect-size at each SNP muj. an Mxk matrix of the true study-level effects etajk an M-length vector of the variance of the study-level effects around the SNP's population level effect omega2j

Examples

1
  generate_data_re1(M=100, p=0.01, tau2=2.5e-4, n=rep(10^4, 10), I2=0.2) 

dan11mcguire/mamba documentation built on Nov. 10, 2020, 12:37 a.m.