testfordiff.ind.pval {QFASA} | R Documentation |
Test for a difference between two independent samples of compositional data. Zeros of any type are allowed.
Description
Test for a difference between two independent samples of compositional data. Zeros of any type are allowed.
Usage
testfordiff.ind.pval(compdata.1, compdata.2, R = 500)
Arguments
compdata.1 |
sample of compositional data. |
compdata.2 |
sample of compositional data. |
R |
number of bootstrap samples, default is 500. |
Value
p-value obtained through a multivariate permutation test with test statistic based on chi-square distances.
References
Stewart, C., Iverson, S. and Field, C. (2014) Testing for a change in diet using fatty acid signatures. Environmental and Ecological Statistics 21, pp. 775-792.
Examples
## Prey
data(preyFAs)
## Capelin FA sig
capelin.sig=preyFAs[preyFAs$Species=="capelin",4:(ncol(preyFAs))]
capelin.sig=capelin.sig/apply(capelin.sig,1,sum)
## Sandlance FA sig
sandlance.sig=preyFAs[preyFAs$Species=="sandlance",4:(ncol(preyFAs))]
sandlance.sig=sandlance.sig/apply(sandlance.sig,1,sum)
# Note: uncomment examples to run. CRAN tests fail because execution time > 5 seconds
# testfordiff.ind.pval(as.matrix(capelin.sig),as.matrix(sandlance.sig))
[Package QFASA version 1.2.0 Index]