| hweboot | R Documentation | 
Iteratively resample individuals/genotypes, calculating the U-statistic for each resample, and use these resamples to test against the null of no equilibrium.
hweboot(n, nboot = 2000, more = FALSE)
n | 
 One of two forms 
  | 
nboot | 
 The number of bootstrap samples to run.  | 
more | 
 A logical. Should we return the bootstrap replicates
(  | 
A list with some or all of the following elements
p_hweThe bootstrap p-value against the null of equilibrium.
p_ciThe 95% confidence interval of p_hwe.
alpha_bootThe bootstrap samples of the double reduction parameter.
u_bootThe bootstrap samples of the U-statistic.
David Gerard
set.seed(1)
ploidy <- 6
size <- 100
r <- 0.5
alpha <- 0.1
qvec <- hwefreq(r = r, alpha = alpha, ploidy = ploidy)
nvec <- c(rmultinom(n = 1, size = size, prob = qvec))
bout <- hweboot(n = nvec, more = TRUE, nboot = 1000)
bout$p_hwe
bout$p_ci
hist(bout$test_boot)
abline(v = bout$test_stat, lty = 2, col = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.