hweustat | R Documentation |
Estimates double reduction and tests for equilibrium while accounting for double reduction. It does this using an approach called "U-process minimization", where we minimize a function of a U-statistic that should be 0 at equilibrium given the true double reduction rate.
hweustat(nvec, thresh = NULL, effdf = TRUE)
nvec |
A vector containing the observed genotype counts,
where |
thresh |
The threshold for ignoring the genotype. We keep
genotypes such that |
effdf |
A logical. Should we use the ad-hoc
"effective degrees of freedom" ( |
This is a two-step estimator, where we first obtain a consistent estimate of the double reduction parameter, use this to estimate the covariance of estimators, then use this to obtain our final estimate of the double reduction parameter.
A list with some or all of the following elements:
alpha
The estimated double reduction parameter(s).
In diploids, this value is NULL
.
chisq_hwe
The chi-square test statistic for testing against the null of equilibrium.
df_hwe
The degrees of freedom associated with
chisq_hwe
.
p_hwe
The p-value against the null of equilibrium.
David Gerard
set.seed(1)
ploidy <- 6
size <- 1000
r <- 0.1
alpha <- 0.1
qvec <- hwefreq(r = r, alpha = alpha, ploidy = ploidy)
nvec <- c(rmultinom(n = 1, size = size, prob = qvec))
hweustat(nvec = nvec)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.