am_simulate {rBahadur}R Documentation

Simulate genotype/phenotype data under equilibrium univariate AM.

Description

Simulate genotype/phenotype data under equilibrium univariate AM.

Usage

am_simulate(h2_0, r, m, n, afs = NULL, min_MAF = 0.1, haplotypes = FALSE)

Arguments

h2_0

generation zero (panmictic) heritability

r

cross-mate phenotypic correlation

m

number of biallelic causal variants

n

sample size

afs

(optional). Allele frequencies to use. If not provided, m will be drawn uniformly from the interval [min_MAF, 1-min_MAF]

min_MAF

(optional) minimum minor allele frequency for causal variants. Ignored if if afs is not NULL. Defaults to 0.1

haplotypes

logical. If TRUE, includes (phased) haploid genotypes in output. Defaults to FALSE

Value

A list including the following objects:

Examples

set.seed(1)
h2_0 = .5; m = 200; n = 1000; r =.5

## simulate genotype/phenotype data
sim_dat <- am_simulate(h2_0, r, m, n)
str(sim_dat)

## empirical h2 vs expected equilibrium h2
(emp_h2 <- var(sim_dat$g)/var(sim_dat$y))
h2_eq(r, h2_0)

[Package rBahadur version 1.0.0 Index]