fstat_varcomps: Calculate variance components for F-statistics

fstat_varcompsR Documentation

Calculate variance components for F-statistics

Description

Takes a list of values of allele frequencies, sample sizes, number of populations, and heterozygosity, and returns variance components, as per Weir & Cockerham (1984). Assumes that all values are for a single biallelic SNP locus.

Note, this function is not exported and is an internal function for fstat_calc.

Usage

fstat_varcomps(pi, ni, r, hi)

Arguments

pi

Numeric: A vector of allele frequencies for each population.

ni

Numeric: A vector of sample sizes (number of diploid individuals) for each population.

r

Integer: A single value, the number of populations.

hi

Numeric: A vector of observed heterozygosities for each population.

Value

Returns a data table with three columns $A, $B, $C, which correspond to the 'a', 'b' and 'c' variance components described in Weir & Cockheram (1984).

References

Weir & Cockerham (1984) Evolution. DOI: 10.1111/j.1558-5646.1984.tb05657.x Weir et al. (2002) Annals of Human Genetics. DOI: 10.1146/annurev.genet.36


j-a-thia/genomalicious documentation built on Oct. 19, 2024, 7:51 p.m.