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

HWf

Computation of inbreeding coefficient


Description

HWf computes the inbreeding coefficient for sample of genotype counts, or a matrix of genotype counts.

Usage

HWf(X)

Arguments

X

a vector or matrix of genotype counts (AA, AB, BB)

Details

For monomorphic markers a warning is issued, and the estimate for the inbreeding coefficient is NaN.

Value

Returns a single inbreeding coefficient (intraclass correlation coefficient), if X is a single sample, or a vector of inbreeding coefficients, if X is a matrix with genotype counts.

Author(s)

Jan Graffelman jan.graffelman@upc.edu

References

Crow, J. F. and Kimura, M. (1970) An introduction to population genetics theory. Harper \& Row, publishers, New York

See Also

Examples

#
# A single sample
#
x <- c(MM=298,MN=489,NN=213)
fhat <- HWf(x)
cat("Inbreeding coefficient: ",fhat,"\n")

#
# Multiple samples
#
X <- HWData(nm=100,n=1000)
fhat <- HWf(X)

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.