Description Usage Arguments Details Value References Examples
View source: R/Neutrality_tests.R
This function performs a statistical test on the null hypothesis that a 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.
1 | is.PD(x, rounds)
|
x |
A discrete data vector. |
rounds |
How many samples are simulated to obtain the empirical distribution. |
The calculated test statistic is
W=∑_{i=1}^n n_i^2 / n ,
which is calculated from the sample. Here n_i are the frequencies of each unique value in the sample.
The MLE of ψ is then estimated from the sample with the function MLEp()
, and an amount of samples
equal to the input parameter rounds
are generated with that estimate of ψ
and sample size n. The test statistic W is then calculated for each of the simulated samples.
The original W is then given a p-value based on what percentage of the simulated W it exceeds.
A p-value.
Watterson, G.A., (1978), The homozygosity test of neutrality. Genetics. 88(2):405-417.
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.