eqdist.etest {energy} | R Documentation |
Performs the nonparametric multisample E-statistic (energy) test for equality of multivariate distributions.
eqdist.etest(x, sizes, distance = FALSE, R = 999) eqdist.e(x, sizes, distance = FALSE)
x |
data matrix of pooled sample |
sizes |
vector of sample sizes |
distance |
logical: if TRUE, first argument is a distance matrix |
R |
number of bootstrap replicates |
The k-sample multivariate E-test of equal distributions
is performed. The statistic is computed from the original
pooled samples, stacked in matrix x
where each row
is a multivariate observation, or the corresponding distance matrix. The
first sizes[1]
rows of x
are the first sample, the next
sizes[2]
rows of x
are the second sample, etc.
The test is implemented by nonparametric bootstrap, an approximate
permutation test with R
replicates. For large samples it is
more efficient if x
contains the data matrix rather than the
distances.
The function eqdist.e
returns the test statistic only; it simply
passes the arguments through to eqdist.etest
with R = 0
.
For computing the statistic only (no test), ksample.e
is usually
faster.
The definition of the multisample E-statistic is given in the
ksample.e
documentation.
A list with class htest
containing
method |
description of test |
statistic |
observed value of the test statistic |
p.value |
approximate p-value of the test |
data.name |
description of data |
eqdist.e
returns test statistic only.
The pairwise e-distances between samples can be conveniently
computed by the edist
function, which returns a dist
object.
The function ksample.e
computes the test statistic without storing
the distances.
Maria L. Rizzo mrizzo @ bgnet.bgsu.edu and Gabor J. Szekely gabors @ bgnet.bgsu.edu
Szekely, G. J. and Rizzo, M. L. (2004) Testing for Equal Distributions in High Dimension, InterStat, November (5).
Szekely, G. J. (2000) Technical Report 03-05: E-statistics: Energy of Statistical Samples, Department of Mathematics and Statistics, Bowling Green State University.
ksample.e
,
edist
energy.hclust
data(iris) ## test if the 3 varieties of iris data (d=4) have equal distributions eqdist.etest(iris[,1:4], c(50,50,50), R = 199)