Simulate GWAS summary statistics directly using a multivariate normal approximation. This method is efficient and designed for a large number of variants.
Examples
R <- matrix(c(1, 0.5, 0.5, 1), nrow = 2) # Example LD matrix
ngwas <- 1000 # Number of GWAS genotypes to sample
beta <- rnorm(2) # Latent eQTL effects
h2ge <- 0.5 # Heritability of gene expression
RL <- get_lower_chol(R) # Compute lower Cholesky decomposition
sim_sumstats(RL, ngwas, beta, h2ge) # Simulate GWAS summary statistics
#> beta se pval
#> 1 -0.5088198 0.02181529 2.531051e-120
#> 2 0.2830234 0.02123620 1.603850e-40