Wednesday, May 4, 2016

Hardy-Weinberg Equilibrium Test in R

install.packages("HardyWeinberg")
library(HardyWeinberg)

X<-c(0,23,1)
names(X)<-c("AA","AB","BB")
HWExact(X,alternative="two.sided",pvaluetype="selome",x.linked=FALSE, verbose=TRUE)

----output----
Haldane Exact test for Hardy-Weinberg equilibrium (autosomal)
using SELOME p-value
sample counts: nAA =  0 nAB =  23 nBB =  1
H0: HWE (D==0), H1: D <> 0
D =  5.510417 p =  0.000008599681 









No comments:

Post a Comment