Distance and Similarity Matrices
A distance matrix gives the pairwise dissimilarity between all cases or variables under a chosen metric, such as Euclidean, Manhattan, Mahalanobis, cosine, Gower or Jaccard.
거리 행렬은 유클리드·맨해튼·마할라노비스·코사인·Gower·자카드 등 선택한 척도로 모든 사례 또는 변수 쌍 사이의 비유사도를 나타낸 행렬입니다.
Which stores in my data are most similar to each other based on size, sales and region type?
매장 규모·매출·지역 유형으로 볼 때 어떤 매장들이 서로 가장 비슷한지 어떻게 찾나요?
Choose a metric that suits the variables, Euclidean or Mahalanobis for numeric data, Gower for mixed numeric and categorical data and Jaccard for presence-absence data, and compute all pairwise distances. The matrix and each item's nearest neighbours show which cases are most alike.
When to use Distance and Similarity Matrices
- You need input for clustering, multidimensional scaling or nearest-neighbour methods.
- You want to find the most similar cases or variables.
- Variables are of mixed type and need a mixed-type distance.
When to use something else
- You want the strength of linear association between variables; use a correlation matrix.
- You need a test of group differences; use PERMANOVA on the distance matrix.
Assumptions and requirements
- Variables scaled appropriately (z or range scaling for unequal units).
- The metric matches the data type (binary for Jaccard, numeric for Mahalanobis).
- At most 5,000 items (seeded subsample).
What the analysis reports
- Summary of all pairwise distances
- Two nearest neighbours per item
- Heatmap of the first 30 items
How to report it
Pairwise [metric] distances among [n] cases ranged from [value] to [value] (median [value]).
Common variants
자주 쓰는 설정
The same analysis with settings already chosen. Each runs Distance and Similarity Matrices itself, at the same price.
- Penrose size distance — metric set to “size”
- Penrose shape distance — metric set to “shape”
- Covariance similarity between profiles — metric set to “covariance”
- Squared correlation similarity — metric set to “sqcorr”
- Power (p, r) distance — metric set to “power”
- Similarity ratio — metric set to “simratio”
- Nonmetric (Lance-Williams) coefficient — metric set to “nonmetric”
- Dot product similarity — metric set to “dot”
- Overlap similarity — metric set to “overlap”
- Chi-square distance between count profiles — metric set to “chisq”
- Phi-square distance between count profiles — metric set to “phisq”
- Simple matching coefficient — metric set to “match”
- Hamann coefficient — metric set to “hamann”
- Rogers-Tanimoto coefficient — metric set to “rogers_tanimoto”
- Sokal-Sneath coefficient — metric set to “sokal_sneath1”
- Dice coefficient — metric set to “dice”
- Russell-Rao coefficient — metric set to “russell_rao”
- Kulczynski coefficient — metric set to “kulczynski1”
- Ochiai binary similarity — metric set to “ochiai”
- Yule's Q binary similarity — metric set to “yule”
- Anderberg binary similarity — metric set to “anderberg”
- Binary Pearson (phi) similarity — metric set to “pearson_binary”
- Gower2 binary similarity — metric set to “gower2”
Related methods
- Hierarchical Clustering
- Multidimensional Scaling
- k-Nearest Neighbours
How this method is validated
이 방법의 검증 근거
- Automated tests. Checked by automated run tests; no external reference comparison is recorded yet.
자동 시험. 자동 실행 시험을 거칩니다. 외부 참조값과 대조한 기록은 아직 없습니다.
Run Distance and Similarity Matrices on Quorant
- Data you need
- a table (CSV or Excel) with predictor (feature) columns
- Price
- 150 credits for one analysis up to 10,000 rows (complexity level 1); larger or wider data costs more. Optional methodologist review: 900 credits.
- Checking
- Automated run tests; no external reference comparison yet
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.