mmds {bios2mds} | R Documentation |
Performs metric MultiDimensional Scaling (MDS) analysis of active elements.
mmds(active, pc = 3, group.file = NULL)
active |
a numeric matrix of distances between active elements. |
pc |
a numeric value indicating the number of principal components to be saved. Default is 3. |
group.file |
a string of characters to indicate the file name assigning groups and colors to each active element. |
Metric multidimensional scaling is a statistical analysis technique aimed at analyzing a matrix of distances between 'active' elements. MDS maps the elements onto a low dimensional space (usually 2D or 3D), In this space, elements are represented by points whose respective distances best approximate the initial distance.
active
must have some characteristics:
active
represents the matrix of pairwise distances between active elements. The active matrix must be symmetric (square and equals to its transpose). The distances on the main diagonal must be equal to 0. The distances do not have to be Euclidean. They can just express a difference or dissimilarity score, with a 0 value between same elements and a positive value between different elements.
The method for the computation of metric MDS is described by Abdi (2007). Briefly, if N is the number of active sequences and D is the N by N matrix of the squared distances computed from the active matrix, the mmds
function performs the following steps:
Transforms D into a cross-product matrix S:
\bold{S} = -0.5 [\bold{I} - \bold{m}^{T}\bold{1}] \times \bold{D} \times [\bold{I} - \bold{m}^{T}\bold{1}]^{T}
where I is the N by N identity matrix, m is the N by 1 matrix mass, where each mass equal to \frac{1}{N}
and 1 is an N by N matrix of ones.
Transforms S into a factor matrix F:
\bold{F} = \bold{M}^{\frac{-1}{2}}\bold{U\Lambda}^{\frac{1}{2}}
where M is the diag{m}, U is the eigenvector matrix and \bold{\Lambda}
is the diagonal matrix of the eigenvalues, such as S = \bold{{U{\Lambda}U}^T}
, where \bold{^T}
denotes the transposition operation.
The eigenvectors of S, also called principal components (whose number is smaller or equal to N), form the active space. F gives the coordinates of the active elements in this space.
A object of class 'mmds', which is a named list of five elements:
eigen |
a numeric vector of the eigenvalues. |
eigen.perc |
a numeric vector of the relative eigenvalues (eigenvalues divided by the sum of the absolute eigenvalues). |
coord |
a named numeric matrix representing the coordinates of active elements. |
group |
a named string matrix representing the differents groups of elements and the associate color (Default is 'NoGroup' and 'black'). |
col |
a named string matrix representing, foreach named elements, the associate group and color (Default is 'NoGroup' and 'black'). |
source |
a named list with 2 elements, the matrix (D) of squared distance and the vector of mass m, that will used for projection of supplementary elements, if required, with the |
If active
do not contain names:
A tag "A" followed by an incremented number names the rows and the columns of active
.
Julien Pele and Jean-Michel Becu
Abdi H (2007) Metric multidimensional scaling. In N.J. Salkind (Ed.): Encyclopedia of Measurement and Statistics. Thousand Oaks (CA): Sage. pp. 598-605.
For further information on multidimentional scaling:
Takane Y, Jung S and Oshima-Takane Y (2009) Multidimensional scaling, in Handbook of quantitative methods in psychology, eds Millsap R, Maydeu-Olivares A (Sage Publications, London) pp. 219-242.
Borg I and Groenen PJF (2005) Modern multidimensional scaling. New York : Springer.
Gower JC (1967) A comparison of some methods of cluster analysis. Biometrics 23:623-637.
ToRgerson WS (1958) Theory and methods of scaling. New York : Wiley.
cmdscale
function from stats
package.
dudi.pco
, suprow
and supcol
functions from ade4
package.
PCA
function from FactoMineR
package.
# performing metric MDS of human GPCRs with projection of
# GPCRs from D. melanogaster as supplementary elements:
data(gpcr)
active <- gpcr$dif$sapiens.sapiens
mmds1 <- mmds(active = active)
mmds1$active.coord