Learn R Programming

gap (version 0.4)

hwe.hardy: Hardy-Weinberg equlibrium test

Description

Hardy-Weinberg equilibrium test by MCMC

Usage

hwe.hardy(a,alleles,seed,sample)

Arguments

a
a trangular array containing the genotype
alleles
number of allele at the locus
seed
pseudo-random number seed, with default value 3000
sample
optional, parameters for MCMC containing # of chunks, size of chunk, burn-in steps, with default values to be 1000, 1000, 5000

Value

  • The returned value is a list containing:
  • pMonte Carlo p value
  • sestandard error of Monte Carlo p value
  • swppercentage of switches

source

http://www.stat.washington.edu/thompson/Genepi/pangaea.shtml,

References

Guo, S.-W. and E. A. Thompson (1992) Performing the Exact Test of Hardy-Weinberg Proportion for Multiple Alleles. Biometrics. 48:361--372.

See Also

genecounting

Examples

Run this code
# example 2 from hwe.doc:
a<-c(
3,
4, 2,
2, 2, 2,
3, 3, 2, 1,
0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 1,
0, 0, 1, 0, 0, 0, 0,
0, 0, 0, 2, 1, 0, 0, 0)
ex2<-hwe.hardy(a,alleles=8,seed=3000,sample=c(1000,1000,5000))

Run the code above in your browser using DataLab