hwenodr: Test for HWE in autopolyploids under the assumption of no...

View source: R/nodr.R

hwenodrR Documentation

Test for HWE in autopolyploids under the assumption of no double reduction

Description

We run a likelihood ratio test against the null of no HWE, assuming that there is no double reduction.

Usage

hwenodr(nvec)

Arguments

nvec

A vector containing the observed genotype counts, where nvec[[i]] is the number of individuals with genotype i-1. This should be of length ploidy+1.

Value

A list with some or all of the following elements

r

The estimated allele frequency.

chisq_hwe

The chi-square statistic against the null of equilibrium given no double reduction.

df_hwe

The degrees of freedom associated with chisq_hwe.

p_hwe

The p-value against the null of equilibrium given no double reduction.

Author(s)

David Gerard

Examples

set.seed(10)
qvec <- c(0.2, 0.3, 0.4, 0.1)
nvec <- c(stats::rmultinom(n = 1, size = 100, prob = qvec))
hwenodr(nvec = nvec)


hwep documentation built on May 31, 2023, 9:06 p.m.