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

HWABO

Estimate allele frequencies and test for Hardy-Weinberg equilibrium with a tri-allelic ABO system.


Description

Function HWABO takes four genotype counts ("A","B","AB","OO") and estimates the three allele frequencies using the EM algorithm.

Usage

HWABO(x, p = c(1/3, 1/3, 1/3), maxiter = 50, tol = 1e-10, verbose = TRUE)

Arguments

x

a vector with genotype counts ("A","B","AB","OO").

p

a vector with initial allele frequencies (by default (1/3,1/3,1/3)).

maxiter

maximum number of iterations.

tol

tolerance for convergence, 1e-10 by default

verbose

print iteration history or not.

Value

pn

vector with estimated allele frequencies.

It.hist

iteration history with log-likelihood.

expected

expected genotype counts under HWE.

Author(s)

Jan Graffelman jan.graffelman@upc.edu

See Also

Examples

x <- c(fA=182,fB=60,nAB=17,nOO=176)
   al.fre <- HWABO(x)
#al2 <- HWABO(x,p=c(0.99,0.01,0.01),maxiter=25)
#al3 <- HWABO(x,p=c(0.01,0.99,0.01),maxiter=25)
#al4 <- HWABO(x,p=c(0.01,0.01,0.99),maxiter=25)

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.