Test the cluster membership for Partitioning Around Medoids (PAM)
jackstraw_pam(
dat,
pam.dat,
s = NULL,
B = NULL,
center = TRUE,
covariate = NULL,
verbose = FALSE,
pool = TRUE,
seed = NULL,
...
)
a matrix with m
rows as variables and n
columns as observations.
an output from applying cluster::pam()
on dat
.
a number of ``synthetic'' null variables. Out of m
variables, s
variables are independently permuted.
a number of resampling iterations.
a logical specifying to center the rows. By default, TRUE
.
a model matrix of covariates with n
observations. Must include an intercept in the first column.
a logical specifying to print the computational progress. By default, FALSE
.
a logical specifying to pool the null statistics across all clusters. By default, TRUE
.
a seed for the random number generator.
optional arguments to control the k-means clustering algorithm (refers to kmeans
).
jackstraw_pam
returns a list consisting of
m
observed F statistics between variables and cluster medoids.
F null statistics between null variables and cluster medoids, from the jackstraw method.
m
p-values of membership.
PAM assigns m
rows into K
clusters. This function enable statistical
evaluation if the cluster membership is correctly assigned. Each of m
p-values refers to
the statistical test of that row with regard to its assigned cluster.
Its resampling strategy accounts for the over-fitting characteristics due to direct computation of clusters from the observed data
and protects against an anti-conservative bias.
For a large dataset, PAM could be too slow. Consider using cluster::clara
and jackstraw::jackstraw_clara
.
The input data (dat
) must be of a class `matrix`.
Chung and Storey (2015) Statistical significance of variables driving systematic variation in high-dimensional data. Bioinformatics, 31(4): 545-554 https://academic.oup.com/bioinformatics/article/31/4/545/2748186
Chung (2020) Statistical significance of cluster membership for unsupervised evaluation of cell identities https://academic.oup.com/bioinformatics/article/36/10/3107/5788523
# NOT RUN {
library(cluster)
set.seed(1234)
dat = t(scale(t(Jurkat293T), center=TRUE, scale=FALSE))
pam.dat <- pam(dat, k=2)
jackstraw.out <- jackstraw_pam(dat, pam.dat = pam.dat)
# }
Run the code above in your browser using DataLab