Computes a distance matrix comparing variables or cases.
Technical details
Description
If a case contains missing values, it is omitted from the analysis. Weights are not applicable when comparing cases. See What is a Distance Matrix? for more information about distance matrices.
Inputs
-
Compare Whether variables or cases are to be compared. You can only compare 100 cases or fewer.
- Case labels If cases are compared, these are the labels to use to refer to each case. Otherwise, the case index is used.
-
Variables The variables that will be included in this analysis.
- Variable names Whether to display Variable Names in the output instead of Variable Labels.
- Categorical as binary Represents unordered categorical variables as binary variables. Otherwise, they are represented as sequential integers (i.e., 1 for the first category, 2 for the second, etc.). Numeric - Multi variables are treated according to their numeric values and not converted to binary.
- Measure Whether to measure similarities or dissimilarities.
-
Similarity measure The type of similarity measure to use:
- Correlation Pearson correlation.
- Cosine The cosine of the angle between a pair of vectors which represent a pair of variables or cases.
-
Distance measure The type of distance/dissimilarity measure to use. The options are (refer to dist for more information):
- Euclidean
- Squared Euclidean The square of the Euclidean distance
- Maximum
- Manhattan
-
Minkowski
- Minkowski power (p) The power parameter for the Minkowski distance measure.
-
Data standardization The standardization method. Choices include:
- None No standardization is performed.
- z-scores Values are transformed to have mean zero and a standard deviation of one.
- Range [-1,1] Values are divided by their range.
- Range [0,1] Values are subtracted by their minimum value and divided by their range.
- Mean of 1 Values are divided by their mean. If the mean is zero, the values will be unchanged.
- Standard deviation of 1 Values are divided by their standard deviation.
- For methods that require variation in the values (z-scores, Range [-1,1], Range [0,1] and Standard deviation of 1), if there is no variation in the values, they will be set to zero instead.
- Standardize by Whether to standardize by variables or cases.
- Measure transformation Transformation of the measures. Choices include None, Absolute values, Reverse sign and Range [0,1]. For Range [0,1], measures on the diagonal are ignored in the transformation.
- Show cell values Whether to display cell values, or if this should be determined based on an estimate of available space (Automatic).
- Show row labels Whether to display row labels.
- Show column labels Whether to display column labels.
Output
Acknowledgements
Uses the R package weights and the d3heatmap htmlwidget.
Method
- In Displayr: How to Create a Distance Matrix
- In Q: How to Create a Distance Matrix