WattersonsW: Watterson's homozygosity test

Description Usage Arguments Value References Examples

View source: R/Neutrality_tests.R

Description

This function performs a statistical test on the null hypothesis thata given sample's underlying distribution is the Poisson-Dirichlet distribution. It calculates a test statistic that is then used to gain a p-value from an empirical distribution of the statistic from simulated samples from a PD distribution.

Usage

1
WattersonsW(x, rounds)

Arguments

x

A data vector.

rounds

How many samples are simulated to obtai nthe empirical distribution.

Value

A p-value.

References

Watterson, G.A., (1978), The homozygosity test of neutrality. Genetics. 88(2):405-417.

Examples

1
2
3
4
5
6
7
8
9
##Test whether a typical sample follows PD:
x<-rPD(1000,10)
WattersonsW(x, 1000)

##Test whether a very atypical sample where frequencies of different values
## are similar:

x<-c(rep(1, 200), rep(2, 200), rep(3, 200), rep(4, 200), rep(5,200))
WattersonsW(x,1000)

ville-kinnula/SPEC documentation built on Dec. 23, 2021, 3:11 p.m.