Last chance! 50% off unlimited learning
Sale ends in
HWE.test.genind
performs Hardy-Weinberg
Equilibrium test on multilocus data (object of class
genind
).
The test itself is performed using the function HWE.test
of the genetics
package.
The output can be of two forms:
- a list of tests (class htest
) for each locus-population
combinaison
- a population x locus matrix containing p-values of the testsHWE.test.genind(x,pop=NULL,permut=FALSE,nsim=1999,hide.NA=TRUE,res.type=c("full","matrix"))
genind
.HWE.test
stating whether
Monte Carlo version (TRUE) should be used or not (FALSE, default).HWE.test
).res
is the "full" output of the
function, then the test for population "PopA" at locus "Myloc" is
given by res$Myloc$PopA. If res
is a matrix of p-values,
populations are in rows and loci in columns. P-values are given for
the upper-tail: they correspond to the probability that an oberved
chi-square statistic as high as or higher than the one observed
occured under H0 (HWE).
In all cases, NA values are likely to appear in fixed loci, or
entirely non-typed loci.HWE.test
documentation (genetics
package).HWE.test
,chisq.test
data(nancycats)
obj <- nancycats
if(require(genetics)){
obj.test <- HWE.test.genind(obj)
# pvalues matrix to have a preview
HWE.test.genind(obj,res.type="matrix")
#more precise view to...
obj.test$fca90$P10
}
Run the code above in your browser using DataLab