Skip to contents

Simulate GWAS summary statistics directly using a multivariate normal approximation. This method is efficient and designed for a large number of variants.

Usage

sim_sumstats(RL, ngwas, beta, h2ge)

Arguments

RL

Lower Cholesky factor of the LD matrix for the population.

ngwas

Number of GWAS genotypes to sample.

beta

Vector of latent eQTL effects for the causal gene.

h2ge

Amount of phenotypic variance explained by the genetic component of gene expression.

Value

A data frame containing estimated GWAS beta, standard error, and p-values.

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