HWChisq {HardyWeinberg}R Documentation

Chi square tests for Hardy Weinberg equilibrium

Description

HWChisq performs the chi-square test for Hardy Weinberg equilibrium with or without continuity correction.

Usage

HWChisq(X, cc = 0, verbose = FALSE)

Arguments

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.

Value

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.

Author(s)

Jan Graffelman jan.graffelman@upc.edu

See Also

HWLratio

Examples

x <- c(298,489,213)
names(x) <- c("MM","MN","NN")
HW.test <- HWChisq(x,verbose=TRUE)

[Package HardyWeinberg version 1.3 Index]