Learn R Programming

shipunov (version 1.17.1)

MDSv: MDS: dimension importance ("explained variance" surrogate)

Description

Calculates R-squared coefficients of the linear relationships between each of derived variables and original data

Usage

MDSv(scores)

Value

Numeric vector, one values per column of scores

Arguments

scores

Data frame or matrix with values (e.g., result of isoMDS())

Author

Alexey Shipunov

Details

MDSv() converts each of the derived variables and original data into distance matrices, and then uses lm() to calculate adjusted R-squared coefficients. These coefficients may be used to understand the "importance" of each new dimension. They work for any dimension reduction techique including multidimensional scaling.

Examples

Run this code

iris.dist <- dist(unique(iris[, -5]), method="manhattan")

iris.cmd <- cmdscale(iris.dist)
MDSv(iris.cmd)

iris.p <- prcomp(iris[, -5])
MDSv(iris.p$x)
100*summary(iris.p)$importance[2, ] # compare with MDSv() results

Run the code above in your browser using DataLab