Testing the significance of each monothetic clustering split by permutation
methods. The "simple-withhold" method ("sw"
) shuffles the observations
between two groups without the splitting variable. The other two methods
shuffle the values in the splitting variable to create a new data set, then
it either splits again on that variable ("resplit-limit", "rl"
) or use all
variables as the splitting candidates ("resplit-nolimit", "rn"
).
perm.test(
object,
data,
auto.pick = FALSE,
sig.val = 0.05,
method = c("sw", "rl", "rn"),
rep = 1000L,
stat = c("f", "aw"),
bon.adj = TRUE,
ncores = 1L
)
The MonoClust
object as the result of the clustering.
The data set which is being clustered.
Whether the algorithm stops when p-value becomes larger than
sig.val
or keeps testing and let the researcher pick the final splitting
tree. Default value is FALSE
.
Significance value to decide when to stop splitting. This
option is ignored if auto.pick = FALSE
, and is 0.05 by default when
auto.pick = TRUE
.
Can be chosen between sw
(simple-withhold, default), rl
(resplit-limit), or rn
(resplit-nolimit). See Details.
Number of permutations required to calculate test statistic.
Statistic to use. Choosing between "f"
(Calinski-Harabasz's
pseudo-F (Calinski and Harabasz, 1974)) or "aw"
(Average silhoutte width
by Rousseeuw (1987)).
Whether to adjust for multiple testing problem using Bonferroni correction.
Number of CPU cores on the current host. When set to NULL, all available cores are used.
The same MonoClust
object with an extra column (p-value), as well
as the numofclusters
object if auto.pick = TRUE
.
The stat
calculated from the shuffles create the reference distribution
to find the p-value. Because the splitting variable that was chosen is
already the best in terms of reduction of inertia, that variable is withheld
from the distance matrix used in the permutation test.
This method shuffles the values of the splitting variables while keeping
other variables fixed to create a new data set, then the chosen stat
is
calculated for each rep to compare with the observed stat
.
Similar to Method 2 but all variables are splitting candidates.
A hypothesis test occurred lower in the monothetic clustering tree could have its p-value corrected for multiple tests happened before it in order to reach that node. The formula is $$adj.p = unadj.p \times depth,$$ with \(depth\) is 1 at the root node.
Calinski, T. and Harabasz, J (1974). "A dendrite method for cluster analysis". en. In: Communications in Statistics 3.1, pp. 1-27. 10.1080/03610927408827101.
Rousseeuw, P. J. (1987). "Silhouettes: A graphical aid to the interpretation and validation of cluster analysis". In: Journal of Computational and Applied Mathematics 20, pp. 53-65. ISSN: 03770427. 10.1016/0377-0427(87)90125-7.
# NOT RUN {
library(cluster)
data(ruspini)
# }
# NOT RUN {
ruspini6sol <- MonoClust(ruspini, nclusters = 6)
ruspini6.p_value <- perm.test(ruspini6sol, data = ruspini, method = "sw",
rep = 1000)
ruspini6.p_value
# }
Run the code above in your browser using DataLab