Learn R Programming

HWEBayes (version 1.4)

HWEsimdat: Simulate data under the single f model with k alleles.

Description

Simulate data under the single $f$ model with $k$ alleles (so $f=0$ gives data under HWE).

Usage

HWEsimdat(npop, q, f)

Arguments

npop
population size.
q
vector of $k$ allele frequencies.
f
value of inbreeding coefficient

Value

  • nvecvector of genotype counts, in the order $n_{11}, n_{21}, n_{22}, ..., n_{k1}, n_{k2}, ..., n_{kk}$.

References

Wakefield, J. (2010). Bayesian methods for examining Hardy-Weinberg equilibrium. Biometrics; Vol 66:257-65

Weir, B.S. (1996). Genetic Data Analysis II. Sunderland MA: Sinauer.

Examples

Run this code
counts <- HWEsimdat(100,q=c(0.1,0.8,.1),f=0.1)

Run the code above in your browser using DataLab