biplotmds.smacof: MDS Biplots

Description Usage Arguments Details Value References See Also Examples

View source: R/biplotmds.smacof.R

Description

Regresses external variables on a MDS configuration which results in a MDS biplot.

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'smacof'
biplotmds(object, extvar, scale = TRUE)
## S3 method for class 'mdsbi'
plot(x, vecscale = NULL, plot.dim = c(1,2), sphere = TRUE, col = 1, 
                     label.conf = list(label = TRUE, pos = 3, col = 1, cex = 0.8), 
                     vec.conf = list(col = 1, cex = 0.8, length = 0.1), 
                     identify = FALSE, type = "p", pch = 20, 
                     asp = 1, main, xlab, ylab, xlim, ylim, ...)

Arguments

object

Object of class "smacof" or "smacofID".

extvar

Data frame with external variables.

scale

If TRUE, external variables are standardized internally.

x

Object of class "mdsbi".

vecscale

Scaling factor for regression coefficients, either a single number or NULL (see details).

plot.dim

Vector with dimensions to be plotted.

main

Plot title.

xlab

Label of x-axis.

ylab

Label of y-axis.

xlim

Scale x-axis.

ylim

Scale y-axis.

pch

Plot symbol.

asp

Aspect ratio.

col

Point color.

type

What type of plot should be drawn.

sphere

In case of spherical smacof, whether sphere should be plotted or not.

label.conf

List with arguments for plotting the labels of the configurations in a configuration plot (logical value whether to plot labels or not, label position, label color).

vec.conf

List with arguments for arrows and arrow labels of the external variables.

identify

If TRUE, the identify() function is called internally that allows to add configuration labels by mouse click.

...

Further plot arguments passed: see plot for detailed information.

Details

If a model for individual differences is provided, the external variables are regressed on the group stimulus space configurations. In the biplot only the relative length of the vectors and their direction matters. Using the scale argument the user can control for the relative length of the vectors. If vecscale = NULL, the vecscale() function from the candisc package is used which tries to automatically calculate the scale factor so that the vectors approximately fill the same space as the configuration.

Value

Returns an object belonging to classes "mlm" and "mdsbi". See lm for details.

R2vec

Vector containing the R2 values.

References

Greenacre, M. (2010). Biplots in Practice. Fundacion BBVA, Bilbao, Spain

See Also

plot.smacof

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## morse code data with external scales
res <- mds(morse)
fitbi <- biplotmds(res, morsescales[,2:3])
plot(fitbi, main = "MDS Biplot", vecscale = 0.5)

## wish data with external economic development factor
diss <- sim2diss(wish, method = 7)
res <- mds(diss, type = "ordinal")
ecdev <- data.frame(ecdev = c(3,1,3,3,8,3,7,9,4,7,10,6))
fitbi <- biplotmds(res, ecdev)
plot(fitbi, main = "MDS Biplot", vecscale = 1)
plot(fitbi, main = "MDS Biplot", vecscale = 0.5, xlim = c(-1, 1), 
vec.conf = list(col = "red", length = 0.05))

## Ekman's color data (by Michael Friendly)
require(colorspace)
wavelengths <- attr(ekman, "Labels")
colors <- c("#2600F0", "#0028FF", "#0092FF", "#00B2FF", "#00FFFF", "#00FF61", "#77FF00", "#B3FF00",
            "#FFF200", "#FFBE00", "#FF9B00", "#FF5700", "#F60000", "#D60000")
ekmanD <- sim2diss(ekman)
res <- mds(ekmanD, type = "ordinal")
RGB <- t(col2rgb(colors)) / 255
HCL <- as(hex2RGB(colors), "polarLUV")
HCL <- slot(HCL, "coords")
fit <- biplotmds(res, cbind(RGB, HCL))
fit
plot(fit, vecscale = 0.5, cex = 6, col = colors,
    label.conf=list(cex = 1, pos = ifelse(wavelengths < 560, 2, 4)),
    vec.conf = list(cex = 1.2), main = "Ekman configuration and color properties" )

smacof documentation built on Feb. 11, 2021, 3 a.m.