Description Usage Arguments Details Value See Also Examples
Test the null hypothesis that Hardy-Weinberg equilibrium holds using the Chi-Square method.
1 2 3 4 |
x |
genotype or haplotype object. |
simulate.p.value |
a logical value indicating whether the p-value
should be computed using simulation instead of using the
Chi-Square approximation. Defaults to |
B |
Number of simulation iterations to use when
|
... |
optional parameters passed to |
This function generates a 2-way table of allele counts, then calls
chisq.test
to compute a p-value for Hardy-Weinberg
Equilibrium. By default, it uses an unadjusted Chi-Square test
statistic and computes the p-value using a simulation/permutation
method. When simulate.p.value=FALSE
, it computes the test
statistic using the Yates continuity correction and tests it against
the asymptotic Chi-Square distribution with the approproate degrees of
freedom.
Note: The Yates continuty correction is applied *only* when
simulate.p.value=FALSE
, so that the reported test statistics
when simulate.p.value=FALSE
and simulate.p.value=TRUE
will differ.
An object of class htest
.
HWE.exact
,
HWE.test
,
diseq
,
diseq.ci
,
allele
,
chisq.test
,
boot
,
boot.ci
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | example.data <- c("D/D","D/I","D/D","I/I","D/D",
"D/D","D/D","D/D","I/I","")
g1 <- genotype(example.data)
g1
HWE.chisq(g1)
# compare with
HWE.exact(g1)
# and
HWE.test(g1)
three.data <- c(rep("A/A",8),
rep("C/A",20),
rep("C/T",20),
rep("C/C",10),
rep("T/T",3))
g3 <- genotype(three.data)
g3
HWE.chisq(g3, B=10000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.