hwe.hardy {gap} | R Documentation |
Hardy-Weinberg equilibrium test by MCMC
hwe.hardy(a,alleles=3,seed=3000,sample=c(1000,1000,5000))
a |
a trangular array containing the genotype |
alleles |
number of allele at the locus, greater than or equal to 3 |
seed |
pseudo-random number seed |
sample |
optional, parameters for MCMC containing # of chunks, size of chunk and burn-in steps |
The returned value is a list containing:
p |
Monte Carlo p value |
se |
standard error of Monte Carlo p value |
swp |
percentage of switches (partial, full and altogether) |
Guo, S.-W. and E. A. Thompson (1992) Performing the exact test of Hardy-Weinberg proportion for multiple alleles. Biometrics. 48:361–372.
Adapted from HARDY, testable with -Dexecutable as standalone program
Sun-Wei Guo, Jing hua Zhao
http://www.stat.washington.edu/thompson/Genepi/pangaea.shtml,
## Not run: # 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) ## End(Not run)