mad.dist | R Documentation |
Computes and returns inter-object median of absolute deviations (MADs) based differences.
mad.dist(X)
X |
objects-by-terms matrix |
object of class dist
giving inter-object MAD distances
J.C. Castura
Chaya, C., Castura, J.C., & Greenacre, M.J. (2025). One citation, one vote! A new approach for analyzing check-all-that-apply (CATA) data in sensometrics, using L1 norm methods. \Sexpr[results=rd]{tools:::Rd_expr_doi("doi:10.48550/arXiv.2502.15945")}
data(bread)
CATA.freq <- apply(bread$cata, 2:3, sum)
# median-center columns (attributes)
CATA.swept <- sweep(CATA.freq, 2, apply(CATA.freq, 2, median))
# cluster analysis of products using complete linkage
dist.Products <- mad.dist(CATA.swept)
plot(as.dendrogram(hclust(dist.Products, method = "complete")), main = "Product clusters")
# cluster analysis of attributes using complete linkage
dist.Att <- mad.dist(t(CATA.swept))
plot(as.dendrogram(hclust(dist.Att, method = "complete")), main = "Attribute clusters")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.