Testing the distribution of points in an ordination
Usage
ordtest(ord, var, dim=c(1:ncol(ord$points)), index = 'euclidean',
nitr = 1000)
Arguments
ord
an object of class pca, pco, or
nmds
var
a logical or factor vector used to organize the calculation
of within-set distances
dim
the number of dimensions to use in the calculation
index
the distance metric for the calculation of within-set distances.
Currently only euclidean is accepted
nitr
the number of iteration to perform to establish p-values
Value
Produces a list with components:
obsthe observed sum of within-set distances
pthe probability of obtaining a value that small
repsthe sum of within-set pairwise distances for all permutations
Details
Calculates the sum of within-set pair-wise distances and compares to nitr
permutations of the same distribution to calculate the probability of observing
clusters as tight as observed or tighter. The p-value is calculated by
running nitr-1 permutations and counting the number of cases where the sum of
pair-wise distances is as small as smaller than observed.
That count is increased by one and divided by nitr to estimate p.