Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

HWLratio

Likelihood ratio test for Hardy Weinberg equilibrium


Description

HWLratio performs the Likelihood ratio test for Hardy Weinberg equilibrium, both for autosomal and X-chromosomal markers.

Usage

HWLratio(X, verbose = TRUE, x.linked = FALSE)

Arguments

X

X a vector containing the genotypic counts (AA,AB,BB).

verbose

verbose = TRUE prints results, verbose = FALSE is silent.

x.linked

x.linked=FALSE indicates the marker is autosomal (default), and x.linked=TRUE indicates it resides on the X-chromosome.

Value

HWLratio returns a list with the components:

Lambda

the likelihood ratio

G2

-2*log(Lambda)

pval

the p-value

Author(s)

Jan Graffelman jan.graffelman@upc.edu

References

Weir, B.S. (1996) Genetic data analysis II. Sinauer Associates, Massachusetts. See Chapter 3.

See Also

Examples

x <- c(298,489,213)
names(x) <- c("MM","MN","NN")
HW.test <- HWLratio(x,verbose=TRUE)
#
# Test for an X-chromsomal SNP.
#
rs5968922 <-  c(A=392, B=212, AA=275, AB=296, BB=80)
HW.test <- HWLratio(rs5968922,x.linked=TRUE,verbose=TRUE)

HardyWeinberg

Statistical Tests and Graphics for Hardy-Weinberg Equilibrium

v1.7.2
GPL (>= 2)
Authors
Jan Graffelman [aut, cre], Christopher Chang [ctb], Xavi Puig [ctb], Jan Wigginton [ctb], Leonardo Ortoleva [ctb], William R. Engels [ctb]
Initial release
2021-04-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.