Description Usage Arguments Details Value Author(s) Source References Examples
Perform a permutation test of equal distribution (mean) for two samples of functional or multivariate data.
1 | tL2.permtest(sample1, sample2, nperm = 25000, use.tbar = FALSE)
|
sample1,sample2 |
lists of function values, object of type |
nperm |
|
use.tbar |
logical, defaults to |
Test statistics are integral means of studentized square distances
between the group means. The test statistics are closely related, but not
equal to Hotelling's two-sample T-squared statistic. It is assumed that
the functions all have the same, equidistant arguments. Depending on the
value of use.tbar
, the test statistic is either
T = mean [ (mu_1(x)-mu_2(x))^2 / (s_1^2(x)/m_1 + s_2^2(x)/m_2) ] or
Tbar = mean [ (mu_1(x)-mu_2(x))^2 ] / mean[ s_1^2(x)/m_1 + s_2^2(x)/m_2 ]
where m_1 m_2 denote the group sizes
for sample1
and sample2
, and mu_1(x), mu_2(x)
and s_1^2(x), s_2^2(x) are within group
means and variances at a fixed argument x.
To calculate T, the mean is taken over all n arguments x.
If nperm
is given as an integer, the permutations are sampled randomly,
unless nperm
is larger than the number of disjoint combinations. In that
case, and also if nperm == NULL
, the exact test with all permutations is used
(combinations, for symmetry reasons). If this causes memory or computing
time issues, set nperm
to a fixed value.
A list with class "htest"
containing the following components:
statistic |
the value of the test statistic, |
p.value |
the p-value of the test, |
alternative |
a character string describing the alternative hypothesis, |
method |
a character string indicating what type of test was performed, |
data.name |
a character string giving the name(s) of the data. |
Ute Hahn, ute@imf.au.dk
Hahn(2012), with slight modification (using the mean instead of the integral, in order to avoid having to pass the arguments of the functions)
Hahn, U. (2012) A Studentized Permutation Test for the Comparison of Spatial Point Patterns. Journal of the American Statistical Association, 107 (498), 754–764.
1 2 | # test the difference of atlantic and continental Canadian temperature curves
tL2.permtest(TempAtla, TempCont, nperm = 999)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.