Last chance! 50% off unlimited learning
Sale ends in
Goodness of fit tests for compositional data.
acompGOF.test(x,...)
acompNormalGOF.test(x,...,method="etest")
# S3 method for formula
acompGOF.test(formula, data,...,method="etest")
# S3 method for list
acompGOF.test(x,...,method="etest")
gsi.acompUniformityGOF.test(x,samplesize=nrow(x)*20,R=999)
acompTwoSampleGOF.test(x,y,...,method="etest",data=NULL)
A classical "htest"
object
The name of the dataset as specified
a name for the test used
an empty string
a dataset of p-value distributions under the Null-Hypothesis got from nonparametric bootstrap
The p.value computed for this test
a dataset of compositions (acomp)
a dataset of compositions (acomp)
number of observations in a reference sample specifying the distribution to compare with. Typically substantially larger than the sample under investigation
The number of replicates to compute the distribution of the test statistic
Selecting a method to be used. Currently only "etest" for using an energy test is supported.
further arguments to the methods
an anova model formula defining groups in the dataset
unused
Up to now the tests can not handle missings.
K.Gerald v.d. Boogaart http://www.stat.boogaart.de
The compositional goodness of fit testing problem is essentially a
multivariate goodness of fit test. However there is a lack of
standardized multivariate goodness of fit tests in R. Some can be found in
the energy
-package.
In principle there is only one test behind the Goodness of fit tests
provided here, a two sample test with test statistic.
The other goodness of fit tests against a specific distribution are
based on estimating the parameters of the distribution, simulating a
large dataset of that distribution and apply the two sample goodness
of fit test.
For the moment, this function covers: two-sample tests, uniformity tests and additive logistic normality tests. Dirichlet distribution tests will be included soon.
Aitchison, J. (1986) The Statistical Analysis of Compositional
Data Monographs on Statistics and Applied Probability. Chapman &
Hall Ltd., London (UK). 416p.
fitDirichlet
,rDirichlet
, runif.acomp
,
rnorm.acomp
,
if (FALSE) {
x <- runif.acomp(100,4)
y <- runif.acomp(100,4)
erg <- acompTwoSampleGOF.test(x,y)
#continue
erg
unclass(erg)
erg <- acompGOF.test(x,y)
x <- runif.acomp(100,4)
y <- runif.acomp(100,4)
dd <- replicate(1000,acompGOF.test(runif.acomp(100,4),runif.acomp(100,4))$p.value)
hist(dd)
dd <- replicate(1000,acompGOF.test(runif.acomp(20,4),runif.acomp(100,4))$p.value)
hist(dd)
dd <- replicate(1000,acompGOF.test(runif.acomp(10,4),runif.acomp(100,4))$p.value)
hist(dd)
dd <- replicate(1000,acompGOF.test(runif.acomp(10,4),runif.acomp(400,4))$p.value)
hist(dd)
dd <- replicate(1000,acompGOF.test(runif.acomp(400,4),runif.acomp(10,4),bandwidth=4)$p.value)
hist(dd)
dd <- replicate(1000,acompGOF.test(runif.acomp(20,4),runif.acomp(100,4)+acomp(c(1,2,3,1)))$p.value)
hist(dd)
# test uniformity
attach("gsi") # the uniformity test is only available as an internal function
x <- runif.acomp(100,4)
gsi.acompUniformityGOF.test.test(x)
dd <- replicate(1000,gsi.acompUniformityGOF.test.test(runif.acomp(10,4))$p.value)
hist(dd)
detach("gsi")
}
Run the code above in your browser using DataLab