class: center, middle, inverse, title-slide # Data Visualization ## MDS: Multidimensional scaling ### Andrew Irwin,
a.irwin@dal.ca
### Math & Stats, Dalhousie University ### 2021-03-03 (updated: 2021-03-03) --- class: middle # Plan * What is MDS and why do we use it? * Demonstration * Comparison with PCA --- class: middle ### What is MDS? * A tool to convert a distance or dissimilarity matrix into a set of points in a plane * Can be based on distances (using one of many metrics) or ranks of dissimilarities, when it is called non-metric MDS (NMDS) * NMDS suitable if you can rank objects as being closer or farther away, by the scale of the quantification is skewed or not important --- ## Cites on a map <img src="../docs/122-mds_files/figure-html/mds-map-cache-1.png" width="90%" style="display: block; margin: auto;" /> --- class: middle ## MDS analysis * Use latitude and longitude of cities to compute distance between each pair * Use MDS on distance matrix to reconstruct relative positions --- ## Cites on a map <img src="../docs/122-mds_files/figure-html/unnamed-chunk-5-1.png" width="90%" style="display: block; margin: auto;" /> --- class: middle ## MDS analysis * Use latitude and longitude of cities to compute distance between each pair * **How do we compute that distance? Euclidean? Great circle?** * Use MDS on distance matrix to reconstruct relative positions --- ## Cites on a map <img src="../docs/122-mds_files/figure-html/unnamed-chunk-6-1.png" width="90%" style="display: block; margin: auto;" /> --- class: middle # How and when to use MDS? * When you can similar pairs of objects are * How similar are the species in two communities? * How similar are two countries based on economic development? * Columns are objects (sample locations, countries) * Be sure the observations (rows) are all measured in the same units * Abundance * Proportions * Scaling or transformation may be required --- class: middle ## How is MDS different from PCA? * PCA is a rotation and projection of data to select linear combinations of original variables that highlight variation * MDS converts pairwise distance or dissimilarity matrix into relative positions * Both make plots of points on abstract axes * Possibly with arrows showing direction of change of other variables --- class: middle # Further reading * Course notes --- class: middle, inverse ## Task * Practice PCA and MDS methods