HWChisq {HardyWeinberg} | R Documentation |
HWChisq
performs the chi-square test for Hardy Weinberg
equilibrium with or without continuity correction.
HWChisq(X, cc = 0, verbose = FALSE)
X |
X a vector containg the genotypic counts (AA,AB,BB). |
cc |
cc the continuity correction parameter (default cc = 0 ). |
verbose |
verbose = 1 prints results, verbose = 0 is silent. |
HWChisq
returns a list with the components:
chisq |
value of the chi-square statistic. NA is returned if the marker is monomorphic. |
pval |
p-value of the chi-square test for Hardy-Weinberg equilibrium. |
D |
Half the deviation from Hardy-Weinberg equilibrium for the AB genotype. |
p |
allele frequency of A. |
Jan Graffelman jan.graffelman@upc.edu
x <- c(298,489,213) names(x) <- c("MM","MN","NN") HW.test <- HWChisq(x,verbose=TRUE)