C.alpha.multinomial {HMP} | R Documentation |
- Optimal Test for Assessing Multinomial Goodness of Fit Versus Dirichlet-Multinomial Alternative
Description
A function to compute the -optimal test statistics of Kim and Margolin (1992)
for evaluating the Goodness-of-Fit of a Multinomial distribution (null hypothesis) versus a Dirichlet-Multinomial
distribution (alternative hypothesis).
Usage
C.alpha.multinomial(data)
Arguments
data |
A matrix of taxonomic counts(columns) for each sample(rows). |
Details
In order to test if a set of ranked-abundance distribution(RAD) from microbiome samples can be modeled better using a multinomial or Dirichlet-Multinomial
distribution, we test the hypothesis versus
,
where the null hypothesis implies a multinomial distribution and the alternative hypothesis implies a DM distribution.
Kim and Margolin (Kim and Margolin, 1992) proposed a
-optimal test- statistics given by,
Where is the number of taxa,
is the number of samples,
is the taxon
,
from sample
,
,
is the number of reads in sample
, and
is the total number of reads across samples.
As the number of reads increases, the distribution of the statistic converges to a Chi-square with degrees of freedom
equal to
, when the number of sequence reads is the same in all samples. When the number of reads is not the same in all samples,
the distribution becomes a weighted Chi-square with a modified degree of freedom (see (Kim and Margolin, 1992) for more details).
Note: Each taxa in data
should be present in at least 1 sample, a column with all 0's may result in errors and/or invalid results.
Value
A list containing the -optimal test statistic and p-value.
References
Kim, B. S., and Margolin, B. H. (1992). Testing Goodness of Fit of a Multinomial Model Against Overdispersed Alternatives. Biometrics 48, 711-719.
Examples
data(saliva)
calpha <- C.alpha.multinomial(saliva)
calpha