hstrobecks: Calculate Strobeck's S for arbitrary parameters

Description Usage Arguments Details Value References See Also Examples

View source: R/hstrobecks.R

Description

Returns Strobeck's S statistic.

Usage

1
hstrobecks(n, k, theta)

Arguments

n

The number of total sequences/individuals

k

The number of unique alleles

theta

The average pairwise nucleotide divergence

Details

Strobeck's S is a population genetics statistic that is used to detect population structure. It is related conceptually (and computationally) to Fu's Fs, which has been argued to be a more appropriate statistic due to it's higher dynamic range, owing to the use of a logit transformation for Fu's Fs. In cases where Fu's Fs becomes more negative, Strobeck's S approaches 1.

Computationally, Strobeck's S and Fu's Fs can be defined in terms of Stirling numbers of the first kind. These numbers can grow large very quickly.

‘hstrobecks' calculates Strobeck’s S directly using Stirling numbers, switching to a logarithmic esimator for Stirling numbers (implemented in the lstirling function) when needed to avoid overflow errors.

Value

Strobeck's S

References

Fu, Y.X. (1996) New statistical tests of neutrality for DNA samples from a population. Genetics 143:557-70 Strobeck, C. (1987) Average number of nucleotide differences in a sample from a single subpopulation: a test for population subdivision. Genetics 117:149-53

See Also

‘hfufs' for a Fu’s Fs calculator and 'lstirling' for the Stirling number estimator

Examples

1
2
3
4
5
n <- 100
k <- 30
theta <- 12.345
hstrobecks(n, k, theta)
# 0.7576966

swainechen/hfufs documentation built on June 22, 2020, 7:02 a.m.