hwelike {hwep} | R Documentation |
Maximum likelihood approach for equilibrium testing and double reduction estimation.
Description
Genotype frequencies from Huang et al (2019) are used to implement a likelihood procedure to estimate double reduction rates and to test for equilibrium while accounting for double reduction. This approach is only implemented for ploidies 4, 6, 8, and 10.
Usage
hwelike(nvec, thresh = 5, effdf = FALSE)
Arguments
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" ( |
Value
A list with some or all of the following elements:
alpha
The estimated double reduction parameter(s). In diploids, this value is
NULL
.r
The estimated allele frequency.
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.
Author(s)
David Gerard
References
Huang, K., Wang, T., Dunn, D. W., Zhang, P., Cao, X., Liu, R., & Li, B. (2019). Genotypic frequencies at equilibrium for polysomic inheritance under double-reduction. G3: Genes, Genomes, Genetics, 9(5), 1693-1706. doi:10.1534/g3.119.400132
Examples
thout <- hwefreq(alpha = 0.1, r = 0.3, ploidy = 6)
nvec <- c(stats::rmultinom(n = 1, size = 100, prob = thout))
hwelike(nvec = nvec)