hw.test: Test of Hardy-Weinberg Equilibrium

Description Usage Arguments Details Value Author(s) Examples

Description

This function tests, for a series of loci, the hypothesis that genotype frequencies follow the Hardy–Weinberg equilibrium.

Usage

1
hw.test(x, B = 1000)

Arguments

x

an object of class "loci".

B

the number of replicates for the Monte Carlo procedure.

Details

This test can be performed with any level of ploidy. Two versions of the test are available: the classical chi^2-test based on the expected genotype frequencies calculated from the allelic frequencies, and an exact test based on Monte Carlo permutations of alleles. For the moment, the latter version is available only for diploids. Set B = 0 if you want to skip the second test.

Value

A matrix with three or four columns with the chi^2-value, the number of degrees of freedom, the associated P-value, and possibly the P-value from the Monte Carlo test. The rows of this matrix are the different loci in x.

Author(s)

Emmanuel Paradis

Examples

1
2
3
4
require(adegenet)
data(nancycats)
x <- as.loci(nancycats)
hw.test(x)

dwinter/Pegas documentation built on May 15, 2019, 6:21 p.m.