corx (version 1.0.6.1)

plot_mds: plot_mds

Description

plot the Classical multidimensional scaling of a corx object

Usage

plot_mds(corx, k = NULL, abs = TRUE, ...)

Arguments

corx

the corx object, or a matrix of correlation coefficients

k

a numeric, the number of clusters. If set to "auto" will be equal to the number of principal components that explain more than 5% of total variance.

abs

if TRUE (the default) negative correlations will be turned positive. This means items with high negative correlations will be treated as highly similar.

...

additional arguments passed to ggpubr::ggscatter

Details

plot_mds performs classic multidimensional scaling on a correlation matrix. The correlation matrix is first converted to a distance matrix using psych::cor2dist. This function employs the following formula: $$dist = \sqrt(2*(1-r))$$ These distances are then passed to stats::cmdscale where k = 2. To compute \(latex\), distances are predict from the cmdscale output and correlated with input distances. This correlation is squared. If the value of \(R^2\) is less than 70 The position of variables is then plotted with ggplot2. Clusters of items are identified using stats::kmeans. The number of clusters is determined using principal component analysis unless specified.

References

Carlson, D.L., 2017. Quantitative methods in archaeology using R. Cambridge University Press.