HWExactPrevious | R Documentation |
HWExactPrevious
performs an exact test for Hardy-Weinberg equilibrium
HWExactPrevious(X, alternative = "two.sided", pvaluetype = "selome",
x.linked = FALSE, verbose = FALSE)
X |
vector with the genotype counts AA, AB, BB |
alternative |
|
pvaluetype |
if |
x.linked |
|
verbose |
print results or not. |
HWExactPrevious
uses the recursion equations described by Wigginton
et. al.
For large samples, HWExactPrevious
may give the error message:
"evaluation nested too deeply: infinite recursion". This can usually
be resolved by increasing R's limit on nested expressions with
options(expressions=10000)
or a higher limit. With higher
limits, the error message "protect(): protection stack overflow" can
occur. This error can usually be resolved by increasing R's
protection stack with the command line option
--max-ppsize 100000
or higer values. However, with such large
samples the exact test will give virtually the same result as a
chi-square test, and it may be easier to use HWChisq
in these
circumstances.
pval |
p-value of the exact test |
prob |
probabilities of all possible samples with the same sample size and minor allele count |
pofthesample |
probability of the observed sample |
Jan Graffelman (jan.graffelman@upc.edu)
Weir, B.S. (1996) Genetic data analysis II. Sinauer Associates, Massachusetts. See Chapter3.
Wigginton, J.E., Cutler, D.J. and Abecasis, G.R. (2005) A note on exact tests of Hardy-Weinberg equilibrium, American Journal of Human Genetics (76) pp. 887-893.
HWLratio
, HWChisq
#
# Example autosomal marker
#
x <- c(298,489,213)
names(x) <- c("MM","MN","NN")
## Not run: HW.test <- HWExactPrevious(x,verbose=TRUE)
#
# Example x-linked marker
#
rs5968922 <- c(A=392, B=212, AA=275, AB=296, BB=80 )
## Not run: HWExactPrevious(rs5968922,x.linked=TRUE,verbose=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.